我在gwt中的文件(web.xml)有错误

时间:2012-10-25 07:53:56

标签: java gwt

我有一个错误,我不知道解决它。 问题是: 当我在我的java类中创建一些东西并且在我按下save之后,我已经将文件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 个答案:

答案 0 :(得分:0)

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

答案 1 :(得分:0)

例外说你的班级:

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

无法找到。尝试确保已在编译和其他运行时

中导入相应的.jar文件

答案 2 :(得分: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>

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

由于

答案 3 :(得分: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,并且每件事情都重新开始了。

从来没有那么奇怪。