0

我有一个通过 Rpc 使用 Objectdb 的 GWT 2.3 Web 应用程序。在 Eclipse 的嵌入式模式下(使用 Jetty),一切运行良好。当我尝试在 Tomcat6 服务器上部署应用程序时,出现以下错误:

29.08.2011 16:07:40 org.apache.catalina.core.ApplicationContext log
SCHWERWIEGEND: Exception while dispatching incoming RPC call
com.google.gwt.user.server.rpc.UnexpectedException: Service method 'public abstract java.util.List coffee.rpc.RpcCallService.getUsers()' threw an unexpected exception: java.lang.NoClassDefFoundError: Could not initialize class com.objectdb.o.RCL
    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:637)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:298)
    at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:859)
    at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:588)
    at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)
    at java.lang.Thread.run(Thread.java:636)
Caused by: java.lang.NoClassDefFoundError: Could not initialize class com.objectdb.o.RCL
    at com.objectdb.o.UNM$z.<init>(UNM.java:163)
    at com.objectdb.o.UNM.x(UNM.java:105)
    at com.objectdb.o.UNM.w(UNM.java:75)
    at com.objectdb.jpa.Provider.createEntityManagerFactory(Provider.java:56)
    at com.objectdb.jpa.Provider.createEntityManagerFactory(Provider.java:32)
    at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:78)
    at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:54)
    at coffee.server.DbHandler.<init>(DbHandler.java:34)
    at coffee.server.DbHandler.getInstance(DbHandler.java:40)
    at coffee.server.RpcCallServiceImpl.getUsers(RpcCallServiceImpl.java:38)
    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)
    ... 17 more

当然,Objectd lib 在构建路径中,而 jar 文件(包括 com.objectdb.o.RCL.class)在其位置(WEB-INF/lib)。任何想法为什么Tomcat在使用objectdb时遇到问题?

4

1 回答 1

0

原来这是一个权限问题。如果您收到此错误,请确保您的 tomcat 可以访问所有必要的文件。

于 2011-09-10T16:14:07.570 回答