GAE(J)、EXTGwt 和 JPA 的问题
您好,我一直在使用 GWT、Extgwt 和JPA 几周了。我有一个简单的称为“区域”并且工作正常的。当我添加 extgwt lib gxt-2.2.3 并创建新类 Area_dto(它扩展了 Extgwt lib 的 BaseModelData)时,出现如下错误
[错误] javax.servlet.ServletContext 日志:分派传入 RPC 调用时出现异常 com.google.gwt.user.server.rpc.UnexpectedException:服务方法“公共抽象java.lang.String com.myday.client.AreaService.greetServer(com.myday.shared.Area)抛出java.lang.IllegalArgumentException”抛出意外异常:java.lang.ExceptionInInitializerError 在 com.google.gwt.user.server.rpc.RPC.encodeResponseForFailure(RPC.java:385) 在 com.google.gwt.user.server.rpc.RPC.invokeAndEncodeResponse(RPC.java:588) 在 com.google.gwt.user.server.rpc.RemoteServiceServlet.processCall(RemoteServiceServlet.java:208) 在 com.google.gwt.user.server.rpc.RemoteServiceServlet.processPost(RemoteServiceServlet.java:248) 在 com.google.gwt.user.server.rpc.AbstractRemoteServiceServlet.doPost(AbstractRemoteServiceServlet.java:62) 在 javax.servlet.http.HttpServlet.service(HttpServlet.java:637) 在 javax.servlet.http.HttpServlet.service(HttpServlet.java:717) 在 org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:511) 在 org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1166) 在 com.google.appengine.tools.development.HeaderVerificationFilter.doFilter(HeaderVerificationFilter.java:35) 在 org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157) 在 com.google.appengine.api.blobstore.dev.ServeBlobFilter.doFilter(ServeBlobFilter.java:58) 在 org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157) 在 com.google.apphosting.utils.servlet.TransactionCleanupFilter.doFilter(TransactionCleanupFilter.java:43) 在 org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157) 在 com.google.appengine.tools.development.StaticFileFilter.doFilter(StaticFileFilter.java:122) 在 org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157) 在 com.google.appengine.tools.development.BackendServersFilter.doFilter(BackendServersFilter.java:94) 在 org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157) 在 org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:388) 在 org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:216) 在 org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:182) 在 org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:765) 在 org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:418) 在 com.google.apphosting.utils.jetty.DevAppEngineWebAppContext.handle(DevAppEngineWebAppContext.java:70) 在 org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152) 在 com.google.appengine.tools.development.JettyContainerService$ApiProxyHandler.handle(JettyContainerService.java:351) 在 org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152) 在 org.mortbay.jetty.Server.handle(Server.java:326) 在 org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:542) 在 org.mortbay.jetty.HttpConnection$RequestHandler.content(HttpConnection.java:938) 在 org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:755) 在 org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:218) 在 org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:404) 在 org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:409) 在 org.mortbay.thread.QueuedThreadPool$PoolThread.run(QueuedThreadPool.java:582) 引起原因:java.lang.ExceptionInInitializerError 在 com.myday.server.AreaServiceImpl.greetServer(AreaServiceImpl.java:19) 在 sun.reflect.NativeMethodAccessorImpl.invoke0(本机方法) 在 sun.reflect.NativeMethodAccessorImpl.invoke(来源未知) 在 sun.reflect.DelegatingMethodAccessorImpl.invoke(来源未知) 在 java.lang.reflect.Method.invoke(来源未知) 在 com.google.appengine.tools.development.agent.runtime.Runtime.invoke(Runtime.java:100) 在 com.google.gwt.user.server.rpc.RPC.invokeAndEncodeResponse(RPC.java:569) ... 34 更多 引起原因:javax.persistence.PersistenceException:提供程序错误。提供程序:org.datanucleus.store.appengine.jpa.DatastorePersistenceProvider 在 javax.persistence.Persistence.createFactory(Persistence.java:176) 在javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:112) 在javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:66) 在 com.myday.server.EMF。(EMF.java:7) ... 41 更多 引起原因:org.datanucleus.exceptions.NucleusUserException:发现类“transactions-Options”是持久性单元“{1}”的一部分,因此加载它以防它是可持久的 在 org.datanucleus.metadata.MetaDataManager.loadPersistenceUnit(MetaDataManager.java:787) 在 org.datanucleus.jpa.EntityManagerFactoryImpl.initialisePMF(EntityManagerFactoryImpl.java:488) 在 org.datanucleus.jpa.EntityManagerFactoryImpl.(EntityManagerFactoryImpl.java:355) 在 org.datanucleus.store.appengine.jpa.DatastoreEntityManagerFactory。(DatastoreEntityManagerFactory.java:63) 在 org.datanucleus.store.appengine.jpa.DatastorePersistenceProvider.createEntityManagerFactory(DatastorePersistenceProvider.java:35) 在 javax.persistence.Persistence.createFactory(Persistence.java:172) ... 44 更多 引起原因:org.datanucleus.exceptions.ClassNotResolvedException:在 CLASSPATH 中找不到类“com.myday.shared.AreaModel”。请检查您的规范和 CLASSPATH。 在 org.datanucleus.JDOClassLoaderResolver.classForName(JDOClassLoaderResolver.java:250) 在 org.datanucleus.JDOClassLoaderResolver.classForName(JDOClassLoaderResolver.java:415) 在 org.datanucleus.metadata.MetaDataManager.loadPersistenceUnit(MetaDataManager.java:767) ... 49 更多
我使用 Eclipse V3.6, GAE V 1.5
谢谢 拉古
Greetings , I have been using GWT,Extgwt & JPA for few weeks. I have simple called Area and Works fine. When i add extgwt lib gxt-2.2.3 and create new class Area_dto which is extends the BaseModelData of Extgwt lib, i got errors as follows
[ERROR] javax.servlet.ServletContext log: Exception while dispatching incoming RPC call
com.google.gwt.user.server.rpc.UnexpectedException: Service method 'public abstract java.lang.String com.myday.client.AreaService.greetServer(com.myday.shared.Area) throws java.lang.IllegalArgumentException' threw an unexpected exception: java.lang.ExceptionInInitializerError
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.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:511)
at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1166)
at com.google.appengine.tools.development.HeaderVerificationFilter.doFilter(HeaderVerificationFilter.java:35)
at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157)
at com.google.appengine.api.blobstore.dev.ServeBlobFilter.doFilter(ServeBlobFilter.java:58)
at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157)
at com.google.apphosting.utils.servlet.TransactionCleanupFilter.doFilter(TransactionCleanupFilter.java:43)
at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157)
at com.google.appengine.tools.development.StaticFileFilter.doFilter(StaticFileFilter.java:122)
at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157)
at com.google.appengine.tools.development.BackendServersFilter.doFilter(BackendServersFilter.java:94)
at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157)
at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:388)
at org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:216)
at org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:182)
at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:765)
at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:418)
at com.google.apphosting.utils.jetty.DevAppEngineWebAppContext.handle(DevAppEngineWebAppContext.java:70)
at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152)
at com.google.appengine.tools.development.JettyContainerService$ApiProxyHandler.handle(JettyContainerService.java:351)
at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152)
at org.mortbay.jetty.Server.handle(Server.java:326)
at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:542)
at org.mortbay.jetty.HttpConnection$RequestHandler.content(HttpConnection.java:938)
at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:755)
at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:218)
at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:404)
at org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:409)
at org.mortbay.thread.QueuedThreadPool$PoolThread.run(QueuedThreadPool.java:582)
Caused by: java.lang.ExceptionInInitializerError
at com.myday.server.AreaServiceImpl.greetServer(AreaServiceImpl.java:19)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at com.google.appengine.tools.development.agent.runtime.Runtime.invoke(Runtime.java:100)
at com.google.gwt.user.server.rpc.RPC.invokeAndEncodeResponse(RPC.java:569)
... 34 more
Caused by: javax.persistence.PersistenceException: Provider error. Provider: org.datanucleus.store.appengine.jpa.DatastorePersistenceProvider
at javax.persistence.Persistence.createFactory(Persistence.java:176)
at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:112)
at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:66)
at com.myday.server.EMF.(EMF.java:7)
... 41 more
Caused by: org.datanucleus.exceptions.NucleusUserException: Class "transactions-optional" found to be part of persistence-unit "{1}" so loading it in case it is persistable
at org.datanucleus.metadata.MetaDataManager.loadPersistenceUnit(MetaDataManager.java:787)
at org.datanucleus.jpa.EntityManagerFactoryImpl.initialisePMF(EntityManagerFactoryImpl.java:488)
at org.datanucleus.jpa.EntityManagerFactoryImpl.(EntityManagerFactoryImpl.java:355)
at org.datanucleus.store.appengine.jpa.DatastoreEntityManagerFactory.(DatastoreEntityManagerFactory.java:63)
at org.datanucleus.store.appengine.jpa.DatastorePersistenceProvider.createEntityManagerFactory(DatastorePersistenceProvider.java:35)
at javax.persistence.Persistence.createFactory(Persistence.java:172)
... 44 more
Caused by: org.datanucleus.exceptions.ClassNotResolvedException: Class "com.myday.shared.AreaModel" was not found in the CLASSPATH. Please check your specification and your CLASSPATH.
at org.datanucleus.JDOClassLoaderResolver.classForName(JDOClassLoaderResolver.java:250)
at org.datanucleus.JDOClassLoaderResolver.classForName(JDOClassLoaderResolver.java:415)
at org.datanucleus.metadata.MetaDataManager.loadPersistenceUnit(MetaDataManager.java:767)
... 49 more
I Use Eclipse V3.6, GAE V 1.5
thanks
Ragu
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
最后我得到了解决方案。
问题是 gxt-xx.jar 不在文件夹 war\WEB-INF\lib 中。我将 gxt-xx.jar 文件复制到 war\WEB-INF\lib 文件夹中,一切正常。
默认情况下,根据我的经验,在 Eclipse GAE 中 gxt-xx.jar 文件未添加到 war\WEB-INF\lib 文件夹中。
感谢大家
Finally i got the solution.
The Problem is gxt-xx.jar is not in folder war\WEB-INF\lib. I copied gxt-xx.jar file into war\WEB-INF\lib folder and everything working good.
By default, In Eclipse GAE gxt-xx.jar file not added in war\WEB-INF\lib folder in my experience.
Thanks to all