部署时App Engine ClassNotFoundException

时间:2013-10-15 13:10:59

标签: java google-app-engine maven gwt gwt-platform

我在部署后运行我的应用时遇到此错误:

Could not instantiate listener com.utilitiessavings.usavappv7.server.guice.GuiceServletConfig
java.lang.ClassNotFoundException: com.utilitiessavings.usavappv7.server.guice.GuiceServletConfig
    at com.google.appengine.runtime.Request.process-8209d48b595b1c2d(Request.java)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:360)
    at org.mortbay.jetty.handler.ContextHandler.loadClass(ContextHandler.java:1101)
    at org.mortbay.jetty.webapp.WebXmlConfiguration.initListener(WebXmlConfiguration.java:630)
    at org.mortbay.jetty.webapp.WebXmlConfiguration.initWebXmlElement(WebXmlConfiguration.java:368)
    at org.mortbay.jetty.webapp.WebXmlConfiguration.initialize(WebXmlConfiguration.java:289)
    at org.mortbay.jetty.webapp.WebXmlConfiguration.configure(WebXmlConfiguration.java:222)
    at org.mortbay.jetty.webapp.WebXmlConfiguration.configureWebApp(WebXmlConfiguration.java:180)
    at org.mortbay.jetty.webapp.WebAppContext.startContext(WebAppContext.java:1247)
    at org.mortbay.jetty.handler.ContextHandler.doStart(ContextHandler.java:517)
    at org.mortbay.jetty.webapp.WebAppContext.doStart(WebAppContext.java:467)
    at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:50)
    at com.google.tracing.TraceContext$TraceContextRunnable.runInContext(TraceContext.java:435)
    at com.google.tracing.TraceContext$TraceContextRunnable$1.run(TraceContext.java:442)
    at com.google.tracing.CurrentContext.runInContext(CurrentContext.java:186)
    at com.google.tracing.TraceContext$AbstractTraceContextCallback.runInInheritedContextNoUnref(TraceContext.java:306)
    at com.google.tracing.TraceContext$AbstractTraceContextCallback.runInInheritedContext(TraceContext.java:298)
    at com.google.tracing.TraceContext$TraceContextRunnable.run(TraceContext.java:439)
    at java.lang.Thread.run(Thread.java:724)

之后是其他几个错误,但似乎我的GuiceServlet(在我的web.xml中定义)由于某种原因无法实例化。下一个错误是相同的,但对于我的uploadServlet,有一些错误是由servlet不可用引起的。

我的应用程序在开发模式下运行正常,使用GWT 2.5.1,GAE 1.8.5和GWTP 1.0.1。

这是我这个项目的第一个maven版本,我不太确定我是否正确部署它。我只是使用Google Eclipse插件中的常规部署方法。

任何指示赞赏。

1 个答案:

答案 0 :(得分:0)

发现我做错了什么。我需要使用maven-gae-plugin来部署它(就像在我的pom.xml中设置的那样,一定是错过了)

运行目标为gae:deploy的maven构建就可以了。

如何为需要它的人设置插件的详细信息:

<pluginRepositories>
   <pluginRepository>
       <id>sonatype.snapshots</id>
       <url>https://oss.sonatype.org/content/repositories/snapshots/</url>
   </pluginRepository>
</pluginRepositories>



<properties>
   <gae.version>1.7.7</gae.version>
   <webappDirectory>${project.build.directory}/${project.build.finalName}</webappDirectory>
   <gae.home>
       ${settings.localRepository}/com/google/appengine/appengine-java-sdk/${gae.version}/appengine-java-sdk-${gae.version}
   </gae.home>
<propertiess>

<plugin>
  <groupId>net.kindleit</groupId>
  <artifactId>maven-gae-plugin</artifactId>
  <version>0.9.5</version>
  <configuration>
      <sdkDir>${gae.home}</sdkDir>
          <!-- Add credentials to ~/.m2/settings.xml <id>appengine-credentials</id> -->
          <serverId>appengine-credentials</serverId>
          <splitJars>true</splitJars>
      </configuration>
      <executions>
          <execution>
              <id>unpack</id>
              <phase>validate</phase>
              <goals>
                  <goal>unpack</goal>
              </goals>
          </execution>
          <execution>
              <id>deploy</id>
              <goals>
                  <goal>deploy</goal>
              </goals>
          </execution>
      </executions>
  </plugin>

请参阅:https://github.com/maven-gae-plugin/maven-gae-plugin