1

当我将系统部署到 Tomcat 时,它显示以下错误信息:

org.apache.catalina.core.ApplicationContext log
SEVERE: Exception while dispatching incoming RPC call
com.google.gwt.user.server.rpc.UnexpectedException: Service method 'public abstract com.google.gwt.user.client.rpc.XsrfToken com.google.gwt.user.client.rpc.XsrfTokenService.getNewXsrfToken()' threw an unexpected exception: java.lang.NoClassDefFoundError: com/google/gwt/util/tools/Utility
        at com.google.gwt.user.server.rpc.RPC.encodeResponseForFailure(RPC.java:385)
        at com.google.gwt.user.server.rpc.RPC.invokeAndEncodeResponse(RPC.java:588)
        at com.google.gwt.user.server.rpc.RemoteServiceServlet.processCall(RemoteServiceServlet.java:208)
        at com.google.gwt.user.server.rpc.RemoteServiceServlet.processPost(RemoteServiceServlet.java:248)
        at com.google.gwt.user.server.rpc.AbstractRemoteServiceServlet.doPost(AbstractRemoteServiceServlet.java:62)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:641)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:306)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
        at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:240)
        at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:161)
        at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:164)
        at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:100)
        at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:541)
        at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
        at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:383)
        at org.apache.coyote.http11.Http11AprProcessor.process(Http11AprProcessor.java:284)
        at org.apache.coyote.http11.Http11AprProtocol$Http11ConnectionHandler.process(Http11AprProtocol.java:322)
        at org.apache.tomcat.util.net.AprEndpoint$SocketWithOptionsProcessor.run(AprEndpoint.java:1648)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
        at java.lang.Thread.run(Thread.java:636)
Caused by: java.lang.NoClassDefFoundError: com/google/gwt/util/tools/Utility
        at com.google.gwt.user.server.rpc.XsrfTokenServiceServlet.generateTokenValue(XsrfTokenServiceServlet.java:198)
        at com.google.gwt.user.server.rpc.XsrfTokenServiceServlet.getNewXsrfToken(XsrfTokenServiceServlet.java:163)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:616)
        at com.google.gwt.user.server.rpc.RPC.invokeAndEncodeResponse(RPC.java:569)
        ... 20 more

这是什么问题?此应用程序在 Eclipse 中运行良好。我的谷歌 SDK 版本是 2.5。

4

3 回答 3

2

这个类 ( )在 GWT 2.4.02.5.0Utility中都没有使用,它只在2.3.0中使用,确实是一个错误。XsrfTokenServiceServlet

您说您使用的是 GWT 2.5.0,所以gwt-servlet.jar您的版本肯定是WEB-INF/libGWT 2.3.0 的过时版本。

于 2012-11-19T09:27:54.693 回答
0

您确定包含 com.google.gwt.util.tools.Utility 的 jar 位于项目的 WEB-INF/lib 或 tomcat/lib 文件夹中吗?看起来tomcat无法找到包含该类的jar。

于 2012-11-18T23:44:13.960 回答
0

com/google/gwt/util/tools/Utility 类在 gwt-dev.jar 中。但是您不需要将 gwt-dev.jar 添加到 WEB-INF/lib,因为 GWT-DEV.jar 仅用于开发模式。您不得在服务器端代码上使用此类或依赖类。

于 2012-11-19T08:54:25.393 回答