0

我有一个错误,我不知道解决它。问题是:当我在我的 java 类中做某事并按下保存后,我已经转到文件 web.xml 以保存它而无需下一个代码:

<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>

这段代码我有评论,然后保存如果我不这样做,那么我会出现下一条消息错误:

    25-oct-2012 9:29:01 com.google.apphosting.utils.jetty.JettyLogger warn
ADVERTENCIA: EXCEPTION 
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.restart(DevAppServerImpl.java:265)
    at com.google.appengine.tools.development.gwt.AppEngineLauncher$AppEngineServletContainer.refresh(AppEngineLauncher.java:51)
    at com.google.gwt.dev.DevMode.onRestartServer(DevMode.java:349)
    at com.google.gwt.dev.shell.remoteui.RemoteUI.restartWebServer(RemoteUI.java:166)
    at com.google.gwt.dev.shell.remoteui.DevModeServiceRequestProcessor.processRestartServer(DevModeServiceRequestProcessor.java:94)
    at com.google.gwt.dev.shell.remoteui.DevModeServiceRequestProcessor.execute(DevModeServiceRequestProcessor.java:59)
    at com.google.gwt.dev.shell.remoteui.MessageTransport.processClientRequest(MessageTransport.java:362)
    at com.google.gwt.dev.shell.remoteui.MessageTransport.processMessage(MessageTransport.java:404)
    at com.google.gwt.dev.shell.remoteui.MessageTransport.access$400(MessageTransport.java:44)
    at com.google.gwt.dev.shell.remoteui.MessageTransport$3.run(MessageTransport.java:322)
    at java.lang.Thread.run(Unknown Source)
25-oct-2012 9:29:01 com.google.appengine.tools.development.ApiProxyLocalImpl log
GRAVE: 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(JettyContainerService.java:191)
    at com.google.appengine.tools.development.AbstractContainerService.startup(AbstractContainerService.java:239)
    at com.google.appengine.tools.development.DevAppServerImpl.restart(DevAppServerImpl.java:265)
    at com.google.appengine.tools.development.gwt.AppEngineLauncher$AppEngineServletContainer.refresh(AppEngineLauncher.java:51)
    at com.google.gwt.dev.DevMode.onRestartServer(DevMode.java:349)
    at com.google.gwt.dev.shell.remoteui.RemoteUI.restartWebServer(RemoteUI.java:166)
    at com.google.gwt.dev.shell.remoteui.DevModeServiceRequestProcessor.processRestartServer(DevModeServiceRequestProcessor.java:94)
    at com.google.gwt.dev.shell.remoteui.DevModeServiceRequestProcessor.execute(DevModeServiceRequestProcessor.java:59)
    at com.google.gwt.dev.shell.remoteui.MessageTransport.processClientRequest(MessageTransport.java:362)
    at com.google.gwt.dev.shell.remoteui.MessageTransport.processMessage(MessageTransport.java:404)
    at com.google.gwt.dev.shell.remoteui.MessageTransport.access$400(MessageTransport.java:44)
    at com.google.gwt.dev.shell.remoteui.MessageTransport$3.run(MessageTransport.java:322)
    at java.lang.Thread.run(Unknown Source)

25-oct-2012 9:29:01 com.google.apphosting.utils.jetty.JettyLogger warn
ADVERTENCIA: failed SystemServiceServlet: java.lang.NullPointerException
25-oct-2012 9:29:01 com.google.apphosting.utils.jetty.JettyLogger warn
ADVERTENCIA: Failed startup of context com.google.appengine.tools.development.DevAppEngineWebAppContext@8d5bff{/,C:\Alberto\workspace\uned\RepresentacionAfc\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.restart(DevAppServerImpl.java:265)
    at com.google.appengine.tools.development.gwt.AppEngineLauncher$AppEngineServletContainer.refresh(AppEngineLauncher.java:51)
    at com.google.gwt.dev.DevMode.onRestartServer(DevMode.java:349)
    at com.google.gwt.dev.shell.remoteui.RemoteUI.restartWebServer(RemoteUI.java:166)
    at com.google.gwt.dev.shell.remoteui.DevModeServiceRequestProcessor.processRestartServer(DevModeServiceRequestProcessor.java:94)
    at com.google.gwt.dev.shell.remoteui.DevModeServiceRequestProcessor.execute(DevModeServiceRequestProcessor.java:59)
    at com.google.gwt.dev.shell.remoteui.MessageTransport.processClientRequest(MessageTransport.java:362)
    at com.google.gwt.dev.shell.remoteui.MessageTransport.processMessage(MessageTransport.java:404)
    at com.google.gwt.dev.shell.remoteui.MessageTransport.access$400(MessageTransport.java:44)
    at com.google.gwt.dev.shell.remoteui.MessageTransport$3.run(MessageTransport.java:322)
    at java.lang.Thread.run(Unknown Source)

有人知道原因吗?

谢谢。

4

4 回答 4

0

感谢您的回答。

我一直在寻找,我已经导入了所有 *.jar 文件

我已经实现了我的应用程序所需的同步方法,这些方法在 web.xml 文件中声明

  <servlet>
    <servlet-name>afcService</servlet-name>
    <servlet-class>com.afc.server.AfcServiceImpl</servlet-class>
  </servlet>

  <servlet-mapping>
    <servlet-name>afcService</servlet-name>
    <url-pattern>/representacionafc/afcService</url-pattern>
  </servlet-mapping>

如果我没有将代码放在上面,那么应用程序没有任何错误,但是如果我取消注释上面的代码,那么我就有问题了。

谢谢

于 2012-10-30T15:41:14.447 回答
0

我有同样的问题,我花了一段时间才弄清楚。

起初我意识到我肯定需要 SystemServiceServlet 来发送邮件,例如

然后我发现这不是 google 或 eclipse 问题,因为如果我在 eclipse 向导上创建了一个全新的 GEA 项目,它对我来说效果很好。

我认为这是一个 maven gwt-maven-plugin 版本 2.5.0-rc1 的问题,因为这个版本的插件没有将 GAE 构建器添加到 eclipse 的构建器部分。

我迁移到版本 2.5.0-rc2 关闭了 eclipse 中的项目清理所有 m2e 内容(.settings、bin 文件夹等)。之后我重新导入了项目并启用了 GAE,一切都恢复了。

无论如何,这真的很奇怪。

于 2013-02-05T17:27:01.783 回答
0

您是否导入了已实现“com.google.api.server.spi.SystemServiceServlet”的 *.jar 文件?

于 2012-10-25T08:01:44.443 回答
0

例外情况是您的班级:

<servlet-class>com.google.api.server.spi.SystemServiceServlet</servlet-class>

找不到。尝试确保您已在编译和其他运行时导入了相应的 .jar 文件

于 2012-10-25T08:03:54.990 回答