3

在 Web 浏览器中运行项目时,我从 Eclipse 集成码头服务器收到 503 错误。我收到此错误,因为我更改了项目的 gae 应用程序 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 我怎么能解决这个问题?请帮忙。

4

3 回答 3

2

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

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

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

于 2012-08-27T03:51:23.923 回答
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...

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

.../workspace/.metadata/.plugins/org.eclipse.wst.server.core/tmp${SERVER_NUM}/${DEPLOYED_APP_NAME}/WEB-INF/appengine-generated/local_db.bin

于 2013-10-25T23:52:57.420 回答
-1

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

于 2013-02-03T10:47:47.863 回答