fl4l
fl4l

Reputation: 1640

How to deploy GWT GAE applications on external server

I Have an GWT+GAE application with nosql database that runs fine in Google App Engine and in eclipse + gwt plugin with embedded jetty server on development environment. Now in production environment, for many causes, i have to deploy this application on an external self managed server like Tomcat or JBoss. I follow with no luck many tutorials and tips&tricks like:

https://developers.google.com/web-toolkit/doc/latest/DevGuideCompilingAndDebugging#How_do_I_use_my_own_server_in_development_mode_instead_of_GWT%27s

https://groups.google.com/forum/?fromgroups=#!topic/google-appengine-java/LYySmvqdbO8

or Link1 Link2 Link3 Link4 Link5

When I deploy my application on an external server (i.e. tomcat or jetty) it starts correctly but when I do a call that uses database connection it gives this error:

Caused by: java.lang.NullPointerException: No API environment is registered for this thread.
    at com.google.appengine.api.datastore.DatastoreApiHelper.getCurrentAppId(DatastoreApiHelper.java:86)
    at com.google.appengine.api.datastore.DatastoreApiHelper.getCurrentAppIdNamespace(DatastoreApiHelper.java:96)
    at com.google.appengine.api.datastore.Query.<init>(Query.java:171)
    at com.google.appengine.api.datastore.Query.<init>(Query.java:102)
    at com.googlecode.objectify.impl.QueryImpl.<init>(QueryImpl.java:69)
    at com.googlecode.objectify.impl.AsyncObjectifyImpl.query(AsyncObjectifyImpl.java:354)
    at com.googlecode.objectify.impl.ObjectifyImpl.query(ObjectifyImpl.java:207)
    at com.beoui.geocell.ObjectifyGeocellQueryEngine.query(ObjectifyGeocellQueryEngine.java:52)
    at com.beoui.geocell.GeocellManager.proximitySearch(GeocellManager.java:381)

How can I deploy to external servers like Tomcat, JBOSS or Jetty? Or it isn't possible at all?

My opinion is: whether the application runs correctly on eclipse embedded jetty, in some way is possible to configure an external jetty distribution to run the application

Upvotes: 1

Views: 635

Answers (1)

Peter Knego
Peter Knego

Reputation: 80330

GAE comes with a set of services which are basically big external systems hidden behind an API. Local dev server is just a Jetty with an embedded database and an API layer mimicking the production GAE. You can not use the dev server for production purposes - it was not made for this and has no concurrency and reliability features of production system.

If you want to run GAE code somewhere else then production GAE service, take a look at AppScale or CapeDwarf.

Also, most links that you provided deal with running GWT app on Tomcat/Jetty, but you have problems with AppEngine. GWT and AppEngine are two separate technologies (which can work together, but it's not required).

Upvotes: 1

Related Questions