在本地运行Development Server中的AppEngine App

时间:2014-08-08 00:20:04

标签: java eclipse google-app-engine maven

我正在按照本教程构建一个AppEngine程序:https://developers.google.com/appengine/docs/java/gettingstarted/setup使用mac os x 64位上的终端

我无法让“留言板”应用在本地的开发服务器上运行。当我运行该程序并尝试在我的网络浏览器中打开它时,它会崩溃一个人可以帮我解决这个问题吗?

我相信由于此验证错误:

  [INFO] Caused by: com.google.apphosting.utils.config.AppEngineConfigException: XML errorvalidating /Users/jamesjohnson/guestbook/guestbook-ear/target/guestbook-ear-1.0-SNAPSHOT/META-INF/appengine-application.xml against /Users/jamesjohnson/.m2/repository/com/google/appengine/appengine-java-sdk/1.9.8/appengine-java-sdk/appengine-java-sdk-1.9.8/docs/appengine-application.xsd

根据教程的说明,我将构建环境设置为以下内容:

3.1.1由M2_HOME变量安装和指向, 运行java 7并让JAVA_HOME变量指向正确的jdk,和 M2变量设置为M2_HOME / bin

我已按照说明的方向创建并配置了项目。

当我构建应用程序时,我收到了BUILD SUCESS消息:

然后当我尝试通过调用此命令在本地计算机上的开发服务器中运行应用程序时:

mvn appengine:devserver

服务器开始运行:

[INFO] <<< appengine-maven-plugin:1.9.8:devserver (default-cli) @ guestbook-ear <<<
[INFO] 
[INFO] --- appengine-maven-plugin:1.9.8:devserver (default-cli) @ guestbook-ear ---
[INFO] 
[INFO] Google App Engine Java SDK - Running Development Server
[INFO] 

然后我收到一条错误消息:

[INFO] com.google.apphosting.utils.config.AppEngineConfigException: Invalid configuration 

后面跟着大约30行描述所有失败的类。最后我仍然得到了一个成功的消息:

 ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 3.180s
[INFO] Finished at: Thu Aug 07 16:44:35 MDT 2014
[INFO] Final Memory: 11M/183M
[INFO] ------------------------------------------------------------------------

我将在下面发布整个错误跟踪:

Jamess-MacBook-Pro-2:guestbook-ear jamesjohnson $ mvn appengine:devserver

    [INFO] Scanning for projects...
    [INFO]                                                                         
    [INFO] ------------------------------------------------------------------------
    [INFO] Building guestbook-ear 1.0-SNAPSHOT
    [INFO] ------------------------------------------------------------------------
    [INFO] 
    [INFO] >>> appengine-maven-plugin:1.9.8:devserver (default-cli) @ guestbook-ear >>>
    [INFO] 
    [INFO] --- maven-ear-plugin:2.8:generate-application-xml (default-generate-application-xml) @      guestbook-ear ---
    [INFO] Generating application.xml
    [INFO] 
    [INFO] --- maven-resources-plugin:2.4.3:resources (default-resources) @ guestbook-ear ---
    [INFO] Using 'UTF-8' encoding to copy filtered resources.
    [INFO] skip non existing resourceDirectory /Users/jamesjohnson/guestbook/guestbook- ear/src/main/resources
    [INFO] 
    [INFO] --- maven-ear-plugin:2.8:ear (default-ear) @ guestbook-ear ---
    [INFO] Copying artifact [war:com.google.appengine.demos:guestbook-war:1.0-SNAPSHOT] to [guestbook-war-1.0-SNAPSHOT.war] (unpacked)
    [INFO] Copy ear sources to /Users/jamesjohnson/guestbook/guestbook-ear/target/guestbook-ear-1.0-SNAPSHOT
    [INFO] Including custom manifest file [/Users/jamesjohnson/guestbook/guestbook-ear/target/guestbook-ear-1.0-SNAPSHOT/META-INF/MANIFEST.MF]
    [INFO] Building jar: /Users/jamesjohnson/guestbook/guestbook-ear/target/guestbook-ear-1.0-SNAPSHOT.ear
    [INFO] 
    [INFO] <<< appengine-maven-plugin:1.9.8:devserver (default-cli) @ guestbook-ear <<<
    [INFO] 
    [INFO] --- appengine-maven-plugin:1.9.8:devserver (default-cli) @ guestbook-ear ---
    [INFO] 
    [INFO] Google App Engine Java SDK - Running Development Server
    [INFO] 
    [INFO] Retrieving Google App Engine Java SDK from Maven
    [INFO] Running /Library/Java/JavaVirtualMachines/jdk1.7.0_67.jdk/Contents/Home/jre/bin/java -XstartOnFirstThread -D--enable_all_permissions=true -Xbootclasspath/p:/Users/jamesjohnson/.m2/repository/com/google/appengine/appengine-java-sdk/1.9.8/appengine-java-sdk/appengine-java-sdk-1.9.8/lib/override/appengine-dev-jdk-overrides.jar -Dappengine.fullscan.seconds=5 -classpath /Users/jamesjohnson/.m2/repository/com/google/appengine/appengine-java-sdk/1.9.8/appengine-java-sdk/appengine-java-sdk-1.9.8/lib/appengine-tools-api.jar com.google.appengine.tools.development.DevAppServerMain --allow_remote_shutdown --no_java_agent /Users/jamesjohnson/guestbook/guestbook-ear/target/guestbook-ear-1.0-SNAPSHOT
    [INFO] com.google.apphosting.utils.config.AppEngineConfigException: Invalid configuration

    [INFO]  at com.google.appengine.tools.development.DevAppServerImpl.reportDeferredConfigurationException(DevAppServerImpl.java:474)

    [INFO]  at     com.google.appengine.tools.development.DevAppServerImpl.doStart(DevAppServerImpl.java:226)
    [INFO]  at com.google.appengine.tools.development.DevAppServerImpl.access$000(DevAppServerImpl.java:47)

    [INFO]  at com.google.appengine.tools.development.DevAppServerImpl$1.run(DevAppServerImpl.java:213)
    [INFO]  at com.google.appengine.tools.development.DevAppServerImpl$1.run(DevAppServerImpl.java:211)
    [INFO]  at java.security.AccessController.doPrivileged(Native Method)

    [INFO]  at com.google.appengine.tools.development.DevAppServerImpl.start(DevAppServerImpl.java:211)
    [INFO]  at com.google.appengine.tools.development.DevAppServerMain$StartAction.apply(DevAppServerMain.java:277)
    [INFO]  at com.google.appengine.tools.util.Parser$ParseResult.applyArgs(Parser.java:48)
    [INFO]  at com.google.appengine.tools.development.DevAppServerMain.run(DevAppServerMain.java:219)

    [INFO]  at com.google.appengine.tools.development.DevAppServerMain.main(DevAppServerMain.java:210)          

    [INFO] Caused by: com.google.apphosting.utils.config.AppEngineConfigException: XML error validating /Users/jamesjohnson/guestbook/guestbook-ear/target/guestbook-ear-1.0-SNAPSHOT/META-INF/appengine-application.xml against /Users/jamesjohnson/.m2/repository/com/google/appengine/appengine-java-sdk/1.9.8/appengine-java-sdk/appengine-java-sdk-1.9.8/docs/appengine-application.xsd

    [INFO]  at com.google.apphosting.utils.config.EarHelper.validateXml(EarHelper.java:253)
    [INFO]  at com.google.apphosting.utils.config.EarHelper.readEarInfo(EarHelper.java:108)
    [INFO]  at com.google.appengine.tools.development.ApplicationConfigurationManager.readEarConfiguration(ApplicationConfigurationManager.java:203)
    [INFO]  at com.google.appengine.tools.development.ApplicationConfigurationManager.<init> (ApplicationConfigurationManager.java:150)

    [INFO]  at com.google.appengine.tools.development.ApplicationConfigurationManager.newEarConfigurationManager(ApplicationConfigurationManager.java:66)
    [INFO]  at com.google.appengine.tools.development.ApplicationConfigurationManager.newEarConfigurationManager(ApplicationConfigurationManager.java:53)
    [INFO]  at com.google.appengine.tools.development.DevAppServerImpl.<init>(DevAppServerImpl.java:132)
    [INFO]  at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)

    [INFO]  at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
    [INFO]  at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
    [INFO]  at java.lang.reflect.Constructor.newInstance(Constructor.java:526)
    [INFO]  at com.google.appengine.tools.development.DevAppServerFactory.doCreateDevAppServer(DevAppServerFactory.java:258)
    [INFO]  at com.google.appengine.tools.development.DevAppServerFactory.access$000(DevAppServerFactory.java:36)
    [INFO]  at com.google.appengine.tools.development.DevAppServerFactory$1.run(DevAppServerFactory.java:226)
    [INFO]  at com.google.appengine.tools.development.DevAppServerFactory$1.run(DevAppServerFactory.java:224)

    [INFO]  at java.security.AccessController.doPrivileged(Native Method)
    [INFO]  at com.google.appengine.tools.development.DevAppServerFactory.createDevAppServer(DevAppServerFactory.java:224)
   [INFO]   at com.google.appengine.tools.development.DevAppServerFactory.createDevAppServer(DevAppServerFactory.java:94)
    [INFO]  at com.google.appengine.tools.development.DevAppServerMain$StartAction.apply(DevAppServerMain.java:265)
   [INFO]   ... 3 more
   [INFO] Caused by: org.xml.sax.SAXParseException; lineNumber: 1; columnNumber: 1; Content is not allowed in prolog.
   [INFO]   at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.createSAXParseException(ErrorHandlerWrapper.java:198)
   [INFO]   at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.fatalError(ErrorHandlerWrapper.java:177)
   [INFO]   at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:441)
   [INFO]   at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:368)
   [INFO]   at com.sun.org.apache.xerces.internal.impl.XMLScanner.reportFatalError(XMLScanner.java:1436)
   [INFO]   at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl$PrologDriver.next(XMLDocumentScannerImpl.java:999)
   [INFO]   at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(XMLDocumentScannerImpl.java:606)
    [INFO]  at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.next(XMLNSDocumentScannerImpl.java:117)
    [INFO]  at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:510)
    [INFO]  at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:848)
    [INFO]  at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:777)
    [INFO]  at c   om.sun.org.apache.xerces.internal.jaxp.validation.StreamValidatorHelper.validate(StreamValidatorHelper.java:155)
    [INFO]  at com.sun.org.apache.xerces.internal.jaxp.validation.ValidatorImpl.validate(ValidatorImpl.java:116)
    [INFO]  at javax.xml.validation.Validator.validate(Validator.java:124)
    [INFO]  at com.google.apphosting.utils.config.EarHelper.validateXml(EarHelper.java:250)
    [INFO]  ... 21 more
    [INFO] ------------------------------------------------------------------------
    [INFO] BUILD SUCCESS
    [INFO] ------------------------------------------------------------------------
    [INFO] Total time: 3.180s
    [INFO] Finished at: Thu Aug 07 16:44:35 MDT 2014
    [INFO] Final Memory: 11M/183M

1 个答案:

答案 0 :(得分:1)

appengine-application.xml文件中存在错误。您在问题中列出的代码和跟踪与此问题无关。