Maven创建了WEB-INF,但是GAE看不到它

时间:2010-08-16 19:00:24

标签: google-app-engine maven-2 spring-mvc

我正在尝试按照有关设置Spring MVC的教程来使用Google App Engine。出于这个问题的目的,我正在使用Eclipse,Maven和Ubuntu开发环境。

我能够成功构建我的应用程序,如下面的代码段所示:

INFO] Building war: /home/james/workspace/springappengine/target/springappengine.war
[DEBUG] adding directory META-INF/
[DEBUG] adding entry META-INF/MANIFEST.MF
[DEBUG] adding directory WEB-INF/
[DEBUG] adding directory WEB-INF/lib/
[DEBUG] adding directory WEB-INF/classes/
[DEBUG] adding directory WEB-INF/classes/com/
[DEBUG] adding directory WEB-INF/classes/com/jameselsey/
[DEBUG] adding directory WEB-INF/classes/com/jameselsey/springappengine/
[DEBUG] adding entry WEB-INF/lib/aopalliance-1.0.jar
[DEBUG] adding entry WEB-INF/lib/spring-context-3.0.3.RELEASE.jar
[DEBUG] adding entry WEB-INF/lib/spring-aop-3.0.3.RELEASE.jar
[DEBUG] adding entry WEB-INF/lib/spring-asm-3.0.3.RELEASE.jar
[DEBUG] adding entry WEB-INF/lib/commons-logging-1.1.1.jar
[DEBUG] adding entry WEB-INF/lib/spring-beans-3.0.3.RELEASE.jar
[DEBUG] adding entry WEB-INF/lib/spring-expression-3.0.3.RELEASE.jar
[DEBUG] adding entry WEB-INF/lib/spring-web-3.0.3.RELEASE.jar
[DEBUG] adding entry WEB-INF/lib/spring-context-support-3.0.3.RELEASE.jar
[DEBUG] adding entry WEB-INF/lib/spring-core-3.0.3.RELEASE.jar
[DEBUG] adding entry WEB-INF/lib/spring-webmvc-3.0.3.RELEASE.jar
[DEBUG] adding entry WEB-INF/web.xml
[DEBUG] adding entry WEB-INF/classes/com/jameselsey/springappengine/HelloController.class
[DEBUG] adding entry WEB-INF/springappengine-servlet.xml
[DEBUG] adding directory META-INF/maven/
[DEBUG] adding directory META-INF/maven/com.jameselsey/
[DEBUG] adding directory META-INF/maven/com.jameselsey/springappengine/
[DEBUG] adding entry META-INF/maven/com.jameselsey/springappengine/pom.xml
[DEBUG] adding entry META-INF/maven/com.jameselsey/springappengine/pom.properties
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 4.619s
[INFO] Finished at: Mon Aug 16 19:54:08 BST 2010
[INFO] Final Memory: 9M/22M
[INFO] ------------------------------------------------------------------------

但是,当我尝试启动应用程序时,我在控制台中收到以下错误消息:

16-Aug-2010 18:56:30 com.google.apphosting.utils.jetty.JettyLogger info
INFO: Logging to JettyLogger(null) via com.google.apphosting.utils.jetty.JettyLogger
com.google.apphosting.utils.config.AppEngineConfigException: Supplied application has to contain WEB-INF directory.
    at com.google.appengine.tools.development.JettyContainerService.determineAppRoot(JettyContainerService.java:319)
    at com.google.appengine.tools.development.JettyContainerService.initContext(JettyContainerService.java:145)
    at com.google.appengine.tools.development.AbstractContainerService.startup(AbstractContainerService.java:144)
    at com.google.appengine.tools.development.DevAppServerImpl.start(DevAppServerImpl.java:219)
    at com.google.appengine.tools.development.DevAppServerMain$StartAction.apply(DevAppServerMain.java:164)
    at com.google.appengine.tools.util.Parser$ParseResult.applyArgs(Parser.java:48)
    at com.google.appengine.tools.development.DevAppServerMain.<init>(DevAppServerMain.java:113)
    at com.google.appengine.tools.development.DevAppServerMain.main(DevAppServerMain.java:89)

这怎么可能?从maven构建输出中,它清楚地显示了为构建创建的WEB-INF目录。

以下是目标目录

上的tree输出
james@nevada:~/workspace/springappengine/target$ pwd
/home/james/workspace/springappengine/target
james@nevada:~/workspace/springappengine/target$ tree
.
|-- classes
|   `-- com
|       `-- jameselsey
|           `-- springappengine
|               `-- HelloController.class
|-- springappengine
|   |-- META-INF
|   `-- WEB-INF
|       |-- classes
|       |   `-- com
|       |       `-- jameselsey
|       |           `-- springappengine
|       |               `-- HelloController.class
|       |-- lib
|       |   |-- aopalliance-1.0.jar
|       |   |-- commons-logging-1.1.1.jar
|       |   |-- spring-aop-3.0.3.RELEASE.jar
|       |   |-- spring-asm-3.0.3.RELEASE.jar
|       |   |-- spring-beans-3.0.3.RELEASE.jar
|       |   |-- spring-context-3.0.3.RELEASE.jar
|       |   |-- spring-context-support-3.0.3.RELEASE.jar
|       |   |-- spring-core-3.0.3.RELEASE.jar
|       |   |-- spring-expression-3.0.3.RELEASE.jar
|       |   |-- spring-web-3.0.3.RELEASE.jar
|       |   `-- spring-webmvc-3.0.3.RELEASE.jar
|       |-- springappengine-servlet.xml
|       `-- web.xml
|-- springappengine.war
|-- test-classes
`-- war
    `-- work
        `-- webapp-cache.xml

15 directories, 17 files

我错过了一些完全明显的东西吗? +代表任何有用的答案!

由于

1 个答案:

答案 0 :(得分:3)

想出来。

在eclipse中,我需要检查运行配置

Arguements标签上有一个节目参与部分

它被设置为: --port=8888 /home/james/workspace/springappengine/war

我需要将其更改为以下内容,以便加载展开的war目录: --port=8888 /home/james/workspace/springappengine/target/springappengine

希望这会帮助其他人处于相同的情况,检查运行配置,默认设置对我不起作用!