java - Google 应用引擎 hello world 程序无法运行

标签 java eclipse google-app-engine

我安装了eclipse GAE插件,然后this简单的教程,当我运行我的程序时,我收到错误消息

    Initializing App Engine server
אוג 23, 2013 12:54:04 PM com.google.apphosting.utils.config.AppEngineWebXmlReader readAppEngineWebXml
INFO: Successfully processed C:\Users\Owner\workspace\GoogleTest2\war\WEB-INF/appengine-web.xml
אוג 23, 2013 12:54:04 PM com.google.apphosting.utils.config.AppEngineWebXmlReader readAppEngineWebXml
SEVERE: Received exception processing C:\Users\Owner\workspace\GoogleTest2\war\WEB-INF/appengine-web.xml
com.google.apphosting.utils.config.AppEngineConfigException: appengine-web.xml does not contain a <threadsafe> element.
See http://code.google.com/appengine/docs/java/config/appconfig.html#Using_Concurrent_Requests for more information.
You probably want to enable concurrent requests.
        at com.google.apphosting.utils.config.AppEngineWebXmlReader.readAppEngineWebXml(AppEngineWebXmlReader.java:85)
        at com.google.apphosting.utils.config.EarHelper.readWebModule(EarHelper.java:166)
        at com.google.appengine.tools.development.ApplicationConfigurationManager$WarModuleConfigurationHandle.readConfiguration(ApplicationConfigurationManager.java:399)
        at com.google.appengine.tools.development.ApplicationConfigurationManager.<init>(ApplicationConfigurationManager.java:146)
        at com.google.appengine.tools.development.ApplicationConfigurationManager.newWarConfigurationManager(ApplicationConfigurationManager.java:88)
        at com.google.appengine.tools.development.DevAppServerImpl.<init>(DevAppServerImpl.java:137)
        at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
        at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
        at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
        at java.lang.reflect.Constructor.newInstance(Unknown Source)
        at com.google.appengine.tools.development.DevAppServerFactory.createDevAppServer(DevAppServerFactory.java:233)
        at com.google.appengine.tools.development.DevAppServerFactory.createDevAppServer(DevAppServerFactory.java:69)
        at com.google.appengine.tools.development.DevAppServerFactory.createDevAppServer(DevAppServerFactory.java:53)
        at com.google.appengine.tools.development.gwt.AppEngineLauncher.start(AppEngineLauncher.java:84)
        at com.google.gwt.dev.DevMode.doStartUpServer(DevMode.java:509)
        at com.google.gwt.dev.DevModeBase.startUp(DevModeBase.java:1093)
        at com.google.gwt.dev.DevModeBase.run(DevModeBase.java:836)
        at com.google.gwt.dev.DevMode.main(DevMode.java:311)

   [ERROR] Unable to start App Engine server
com.google.apphosting.utils.config.AppEngineConfigException: Invalid configuration
        at com.google.appengine.tools.development.DevAppServerImpl.reportDeferredConfigurationException(DevAppServerImpl.java:414)
        at com.google.appengine.tools.development.DevAppServerImpl.start(DevAppServerImpl.java:211)
        at com.google.appengine.tools.development.gwt.AppEngineLauncher.start(AppEngineLauncher.java:97)
        at com.google.gwt.dev.DevMode.doStartUpServer(DevMode.java:509)
        at com.google.gwt.dev.DevModeBase.startUp(DevModeBase.java:1093)
        at com.google.gwt.dev.DevModeBase.run(DevModeBase.java:836)
        at com.google.gwt.dev.DevMode.main(DevMode.java:311)
Caused by: com.google.apphosting.utils.config.AppEngineConfigException: Invalid appengine-web.xml(C:\Users\Owner\workspace\GoogleTest2\war\WEB-INF/appengine-web.xml) - appengine-web.xml does not contain a <threadsafe> element.
See http://code.google.com/appengine/docs/java/config/appconfig.html#Using_Concurrent_Requests for more information.
You probably want to enable concurrent requests.
        at com.google.apphosting.utils.config.EarHelper.readWebModule(EarHelper.java:168)
        at com.google.appengine.tools.development.ApplicationConfigurationManager$WarModuleConfigurationHandle.readConfiguration(ApplicationConfigurationManager.java:399)
        at com.google.appengine.tools.development.ApplicationConfigurationManager.<init>(ApplicationConfigurationManager.java:146)
        at com.google.appengine.tools.development.ApplicationConfigurationManager.newWarConfigurationManager(ApplicationConfigurationManager.java:88)
        at com.google.appengine.tools.development.DevAppServerImpl.<init>(DevAppServerImpl.java:137)
        at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
        at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
        at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
        at java.lang.reflect.Constructor.newInstance(Unknown Source)
        at com.google.appengine.tools.development.DevAppServerFactory.createDevAppServer(DevAppServerFactory.java:233)
        at com.google.appengine.tools.development.DevAppServerFactory.createDevAppServer(DevAppServerFactory.java:69)
        at com.google.appengine.tools.development.DevAppServerFactory.createDevAppServer(DevAppServerFactory.java:53)
        at com.google.appengine.tools.development.gwt.AppEngineLauncher.start(AppEngineLauncher.java:84)
        ... 4 more
Unable to start embedded HTTP server
com.google.gwt.core.ext.UnableToCompleteException: (see previous log entries)
        at com.google.appengine.tools.development.gwt.AppEngineLauncher.start(AppEngineLauncher.java:102)
        at com.google.gwt.dev.DevMode.doStartUpServer(DevMode.java:509)
        at com.google.gwt.dev.DevModeBase.startUp(DevModeBase.java:1093)
        at com.google.gwt.dev.DevModeBase.run(DevModeBase.java:836)
        at com.google.gwt.dev.DevMode.main(DevMode.java:311)
[ERROR] shell failed in doStartupServer method

有什么想法吗? 谢谢!

最佳答案

您的appengine-web.xml文件缺少一个条目。对于 hello-world 你不想处理并发(还)所以添加:

<threadsafe>false</threadsafe>

到此文件。您可以在 war/META-INF/ 中找到它。

一旦创建了并发应用程序(稍后才会出现),您可以将其设置为 true。

关于java - Google 应用引擎 hello world 程序无法运行,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18399945/

相关文章:

java - 如何检测以全屏模式运行的非 Java 程序?

java - Java 类中完整描述的 EhCache 复制不起作用

java - Gradle Tooling API - 查找 GradleProject 的所有任务

css - 在 Gwt WindowBuilder 中编辑 CSS

java - 如何使用 WindowBuilder 在 Eclipse Mars 中调整 Tab 键顺序

java.lang.NoClassDefFoundError : Could not initialize class com. googlecode.luceneappengine.GaeDirectory

java - 使用 spring 数据启用 hibernate 日志记录?

java - Minecraft [GRADLE] 1.7.2 - 无法使用外部 .jar?

html - CSS 文件未加载 GAE

google-app-engine - Objectify - 如何@Load a List<Ref<?>>?