我有一个带有nosql数据库的GWT + GAE应用程序,可以在Google App Engine和eclipse + gwt插件中运行,并且在开发环境中使用嵌入式jetty服务器。 现在在生产环境中,由于许多原因,我必须在外部自我管理服务器(如Tomcat或JBoss)上部署此应用程序。 我没有运气很多教程和提示和技巧,如:
https://groups.google.com/forum/?fromgroups=#!topic/google-appengine-java/LYySmvqdbO8
或Link1 Link2 Link3 Link4 Link5
当我在外部服务器(即tomcat或jetty)上部署我的应用程序时,它正确启动但是当我进行使用数据库连接的调用时,它会出现此错误:
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)
如何部署到Tomcat,JBOSS或Jetty等外部服务器? 还是it isn't possible?
我的观点是:应用程序是否在eclipse嵌入式jetty上正确运行,在某种程度上可以配置外部jetty分发来运行应用程序
答案 0 :(得分:1)
GAE带有set of services,它们基本上是隐藏在API背后的大型外部系统。本地开发服务器只是一个带有嵌入式数据库和模仿生产GAE的API层的Jetty。您不能将开发服务器用于生产目的 - 它不是为此而制作的,并且没有生产系统的并发性和可靠性功能。
如果您想在其他地方运行GAE代码然后生成GAE服务,请查看AppScale或CapeDwarf。
此外,您提供的大多数链接都涉及在Tomcat / Jetty上运行GWT应用程序,但您在使用AppEngine时遇到问题。 GWT和AppEngine是两种不同的技术(可以一起使用,但不是必需的)。