【问题标题】:Maven created WEB-INF, but GAE can't see itMaven创建WEB-INF,GAE看不到
【发布时间】:2010-08-16 19:00:24
【问题描述】:

我正在尝试遵循有关设置 Spring MVC 以在 Google App Engine 上工作的教程。出于这个问题的目的,我使用的是 Eclipse、Maven 和 Ubuntu 开发环境。

我能够成功构建我的应用程序,如下面的 sn-p 所示:

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

我是否遗漏了一些非常明显的东西? +代表任何有用的答案!

谢谢

【问题讨论】:

  • 您是否检查了springappengine.war 文件的内容以确保它与目标目录中的输出匹配?

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


【解决方案1】:

想通了。

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

Arguements 选项卡上有一个程序争论部分

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

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

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

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2010-12-19
    • 1970-01-01
    • 2011-06-22
    • 2013-10-19
    • 1970-01-01
    • 2017-06-22
    相关资源
    最近更新 更多