http 503错误gwt jetty服务器SERVICE_UNAVAILABLE

时间:2012-08-21 17:45:46

标签: eclipse google-app-engine gwt jetty

我在Web浏览器中运行项目时从eclipse集成的jetty服务器收到503错误。我得到了这个错误,因为我改变了项目的gae application-id。

java.lang.ClassNotFoundException: com.google.api.server.spi.SystemServiceServlet
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at com.google.appengine.tools.development.IsolatedAppClassLoader.loadClass(IsolatedAppClassLoader.java:176)
at java.lang.ClassLoader.loadClass(Unknown Source)
at org.mortbay.util.Loader.loadClass(Loader.java:91)
at org.mortbay.util.Loader.loadClass(Loader.java:71)
at org.mortbay.jetty.servlet.Holder.doStart(Holder.java:73)
at org.mortbay.jetty.servlet.ServletHolder.doStart(ServletHolder.java:242)
at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:50)
at org.mortbay.jetty.servlet.ServletHandler.initialize(ServletHandler.java:685)
at org.mortbay.jetty.servlet.Context.startContext(Context.java:140)
at org.mortbay.jetty.webapp.WebAppContext.startContext(WebAppContext.java:1250)
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 org.mortbay.jetty.handler.HandlerWrapper.doStart(HandlerWrapper.java:130)
at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:50)
at org.mortbay.jetty.handler.HandlerWrapper.doStart(HandlerWrapper.java:130)
at org.mortbay.jetty.Server.doStart(Server.java:224)
at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:50)
at com.google.appengine.tools.development.JettyContainerService.startContainer(JettyContainerService.java:191)
at com.google.appengine.tools.development.AbstractContainerService.startup(AbstractContainerService.java:239)
at com.google.appengine.tools.development.DevAppServerImpl.start(DevAppServerImpl.java:146)
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:1068)
at com.google.gwt.dev.DevModeBase.run(DevModeBase.java:811)
at com.google.gwt.dev.DevMode.main(DevMode.java:311)
    21.08.2012 16:09:42 com.google.appengine.tools.development.ApiProxyLocalImpl log
    SCHWERWIEGEND: javax.servlet.ServletContext log: unavailable
    javax.servlet.UnavailableException: com.google.api.server.spi.SystemServiceServlet
at org.mortbay.jetty.servlet.Holder.doStart(Holder.java:79)
at org.mortbay.jetty.servlet.ServletHolder.doStart(ServletHolder.java:242)
at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:50)
at org.mortbay.jetty.servlet.ServletHandler.initialize(ServletHandler.java:685)
at org.mortbay.jetty.servlet.Context.startContext(Context.java:140)
at org.mortbay.jetty.webapp.WebAppContext.startContext(WebAppContext.java:1250)
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 org.mortbay.jetty.handler.HandlerWrapper.doStart(HandlerWrapper.java:130)
at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:50)
at org.mortbay.jetty.handler.HandlerWrapper.doStart(HandlerWrapper.java:130)
at org.mortbay.jetty.Server.doStart(Server.java:224)
at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:50)
at   com.google.appengine.tools.development.JettyContainerService.startContainer(JettyContainerS ervice.java:191)
at com.google.appengine.tools.development.AbstractContainerService.startup(AbstractContainerService.java:239)
at com.google.appengine.tools.development.DevAppServerImpl.start(DevAppServerImpl.java:146)
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:1068)
at com.google.gwt.dev.DevModeBase.run(DevModeBase.java:811)
at com.google.gwt.dev.DevMode.main(DevMode.java:311)

    21.08.2012 16:09:42 com.google.apphosting.utils.jetty.JettyLogger warn
    WARNUNG: failed SystemServiceServlet: java.lang.NullPointerException
    21.08.2012 16:09:43 com.google.apphosting.utils.jetty.JettyLogger warn
    WARNUNG: Failed startup of context    com.google.appengine.tools.development.DevAppEngineWebAppContext@9f4160a{/,C:\Users\dp\work        space\fooApp\war}
    java.lang.NullPointerException
     at java.lang.Class.isAssignableFrom(Native Method)
at org.mortbay.jetty.servlet.ServletHolder.doStart(ServletHolder.java:256)
at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:50)
at org.mortbay.jetty.servlet.ServletHandler.initialize(ServletHandler.java:685)
at org.mortbay.jetty.servlet.Context.startContext(Context.java:140)
at org.mortbay.jetty.webapp.WebAppContext.startContext(WebAppContext.java:1250)
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 org.mortbay.jetty.handler.HandlerWrapper.doStart(HandlerWrapper.java:130)
at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:50)
at org.mortbay.jetty.handler.HandlerWrapper.doStart(HandlerWrapper.java:130)
at org.mortbay.jetty.Server.doStart(Server.java:224)
at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:50)
at com.google.appengine.tools.development.JettyContainerService.startContainer(JettyContainerService.java:191)
at com.google.appengine.tools.development.AbstractContainerService.startup(AbstractContainerService.java:239)
at com.google.appengine.tools.development.DevAppServerImpl.start(DevAppServerImpl.java:146)
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:1068)
at com.google.gwt.dev.DevModeBase.run(DevModeBase.java:811)
at com.google.gwt.dev.DevMode.main(DevMode.java:311)
    21.08.2012 16:09:46 com.google.appengine.tools.development.DevAppServerImpl start
    INFO: The server is running at http://localhost:8888/
    21.08.2012 16:09:46 com.google.appengine.tools.development.DevAppServerImpl start
    INFO: The admin console is running at http://localhost:8888/_ah/admin

这是我的web.xml文件

<!-- Default page to serve -->
<welcome-file-list>
   <welcome-file>fooApp.html</welcome-file>
</welcome-file-list>
<servlet>
   <servlet-name>phonegapfileapi</servlet-name>
   <servlet           class>com.googlecode.gwtphonegap.server.file.FileRemoteServiceServlet</servlet-class>
   </servlet>
   <servlet-mapping>
      <servlet-name>phonegapfileapi</servlet-name>
      <url-pattern>/showcase/phonegapfileapi</url-pattern>
   </servlet-mapping>
   <servlet>
       <servlet-name>SystemServiceServlet</servlet-name>
       <servlet-class>com.google.api.server.spi.SystemServiceServlet</servlet-class>
       <init-param>
          <param-name>services</param-name>
       <param-value/>
     </init-param>
   </servlet>

   <servlet-mapping>
      <servlet-name>SystemServiceServlet</servlet-name>
      <url-pattern>/_ah/spi/*</url-pattern>
   </servlet-mapping>

所有罐子都在fooApp / war / WEB-INF / lib中 我怎么能解决这个问题? 请帮忙。

3 个答案:

答案 0 :(得分:2)

我遇到了同样的问题。仅当您要在jetty中部署Web管理servlet时,似乎才需要SystemServiceServlet。

在我的情况下,问题是GAE eclipse插件默认使用 GAE Java SDK 1.6 ,com.google.api.server包甚至没有。我通过手动将SDK设置为 GAE SDK 1.7 来修复它。

更改SDK时要小心,我尝试更改默认SDK但仍然遇到此问题,直到我选择“使用特定SDK”指向1.7。

答案 1 :(得分:0)

我正在使用maven,但遇到了同样的问题。对于maven,我们没有在项目属性中设置SDK版本,而是我们有这个插件:

<plugin>
    <groupId>com.google.appengine</groupId>
    <artifactId>appengine-maven-plugin</artifactId>
    <version>1.8.3</version>

解决异常Window/Show View/Other... > Servers/Server然后右键单击已使用的AppEngine服务器,然后点击Clean...

注意:这将擦除您的本地开发数据存储区,因此如果您想保留数据,请备份该文件:

  

... /工作区/ .metadata / .plugins / org.eclipse.wst.server.core / TMP $ {SERVER_NUM} / $ {DEPLOYED_APP_NAME} /WEB-INF/appengine-generated/local_db.bin

答案 2 :(得分:-1)

解决方案在我的情况下 - 只需在任务管理器中杀死所有javaw.exe * 32进程。