在Eclipse中以托管模式运行我的应用程序时,我不时会遇到这组异常。有什么奇怪的,它不是一直发生的。重新编译并重新启动应用程序后偶尔会发生这种情况。重新启动Eclipse通常会将其清除(无需更改代码)。有没有人对这里可能发生的事情有任何想法?或者甚至在我开始寻找的地方?
[ERROR] javax.servlet.ServletContext log: Exception while dispatching incoming RPC call com.google.gwt.user.server.rpc.UnexpectedException: Service method 'public abstract com.grgcomponents.coatl.client.auth.TwitterUser com.grgcomponents.coatl.client.auth.TwitterLoginService.getLoggedInUser(java.lang.String) throws java.lang.IllegalArgumentException' threw an unexpected exception: java.lang.UnsupportedOperationException at com.google.gwt.user.server.rpc.RPC.encodeResponseForFailure(RPC.java:378) at com.google.gwt.user.server.rpc.RPC.invokeAndEncodeResponse(RPC.java:581) at com.google.gwt.user.server.rpc.RemoteServiceServlet.processCall(RemoteServiceServlet.java:207) at com.google.gwt.user.server.rpc.RemoteServiceServlet.processPost(RemoteServiceServlet.java:243) 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.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 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:349) 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.UnsupportedOperationException at org.datanucleus.store.appengine.EntityUtils.getPropertyName(EntityUtils.java:62) at org.datanucleus.store.appengine.DatastoreFieldManager.getPropertyName(DatastoreFieldManager.java:1073) at org.datanucleus.store.appengine.DatastoreFieldManager.fetchObjectField(DatastoreFieldManager.java:309) at org.datanucleus.store.appengine.DatastoreFieldManager.fetchLongField(DatastoreFieldManager.java:429) at org.datanucleus.state.AbstractStateManager.replacingLongField(AbstractStateManager.java:1148) at com.grgcomponents.coatl.server.persisted.TwitterOAuthTokens.jdoReplaceField(TwitterOAuthTokens.java) at com.grgcomponents.coatl.server.persisted.TwitterOAuthTokens.jdoReplaceFields(TwitterOAuthTokens.java) at org.datanucleus.state.JDOStateManagerImpl.replaceFields(JDOStateManagerImpl.java:2772) at org.datanucleus.state.JDOStateManagerImpl.replaceFields(JDOStateManagerImpl.java:2791) at org.datanucleus.store.appengine.DatastorePersistenceHandler.fetchObject(DatastorePersistenceHandler.java:480) at org.datanucleus.state.JDOStateManagerImpl.validate(JDOStateManagerImpl.java:4263) at org.datanucleus.ObjectManagerImpl.findObject(ObjectManagerImpl.java:2444) at org.datanucleus.jpa.EntityManagerImpl.find(EntityManagerImpl.java:234) at org.datanucleus.store.appengine.jpa.DatastoreEntityManager.find(DatastoreEntityManager.java:56) at com.grgcomponents.coatl.server.auth.TwitterLoginServiceImpl.getCurrentUser(TwitterLoginServiceImpl.java:45) at com.grgcomponents.coatl.server.auth.TwitterLoginServiceImpl.getLoggedInUser(TwitterLoginServiceImpl.java:30) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at com.google.appengine.tools.development.agent.runtime.Runtime.invoke(Runtime.java:100) at com.google.gwt.user.server.rpc.RPC.invokeAndEncodeResponse(RPC.java:562) ... 30 more [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.grgcomponents.coatl.client.preferences.UserSettingsService.getSetting(java.lang.String,java.lang.String)' threw an unexpected exception: java.lang.UnsupportedOperationException at com.google.gwt.user.server.rpc.RPC.encodeResponseForFailure(RPC.java:378) at com.google.gwt.user.server.rpc.RPC.invokeAndEncodeResponse(RPC.java:581) at com.google.gwt.user.server.rpc.RemoteServiceServlet.processCall(RemoteServiceServlet.java:207) at com.google.gwt.user.server.rpc.RemoteServiceServlet.processPost(RemoteServiceServlet.java:243) 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.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 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:349) 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.QueuedThreacom.google.gwt.user.client.rpc.StatusCodeException: 500 The call failed on the server; see server log for details at com.google.gwt.user.client.rpc.impl.RequestCallbackAdapter.onResponseReceived(RequestCallbackAdapter.java:192) at com.google.gwt.http.client.Request.fireOnResponseReceived(Request.java:287) at com.google.gwt.http.client.RequestBuilder$1.onReadyStateChange(RequestBuilder.java:395) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at com.google.gwt.dev.shell.MethodAdaptor.invoke(MethodAdaptor.java:103) at com.google.gwt.dev.shell.MethodDispatch.invoke(MethodDispatch.java:71) at com.google.gwt.dev.shell.OophmSessionHandler.invoke(OophmSessionHandler.java:157) at com.google.gwt.dev.shell.BrowserChannelServer.reactToMessagesWhileWaitingForReturn(BrowserChannelServer.java:326) at com.google.gwt.dev.shell.BrowserChannelServer.invokeJavascript(BrowserChannelServer.java:207) at com.google.gwt.dev.shell.ModuleSpaceOOPHM.doInvoke(ModuleSpaceOOPHM.java:126) at com.google.gwt.dev.shell.ModuleSpace.invokeNative(ModuleSpace.java:561) at com.google.gwt.dev.shell.ModuleSpace.invokeNativeObject(ModuleSpace.java:269) at com.google.gwt.dev.shell.JavaScriptHost.invokeNativeObject(JavaScriptHost.java:91) at com.google.gwt.core.client.impl.Impl.apply(Impl.java) at com.google.gwt.core.client.impl.Impl.entry0(Impl.java:214) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at com.google.gwt.dev.shell.MethodAdaptor.invoke(MethodAdaptor.java:103) at com.google.gwt.dev.shell.MethodDispatch.invoke(MethodDispatch.java:71) at com.google.gwt.dev.shell.OophmSessionHandler.invoke(OophmSessionHandler.java:157) at com.google.gwt.dev.shell.BrowserChannelServer.reactToMessages(BrowserChannelServer.java:281) at com.google.gwt.dev.shell.BrowserChannelServer.processConnection(BrowserChannelServer.java:531) at com.google.gwt.dev.shell.BrowserChannelServer.run(BrowserChannelServer.java:352) at java.lang.Thread.run(Thread.java:680) dPool$PoolThread.run(QueuedThreadPool.java:582) Caused by: java.lang.UnsupportedOperationException at org.datanucleus.store.appengine.EntityUtils.getPropertyName(EntityUtils.java:62) at org.datanucleus.store.appengine.DatastoreFieldManager.getPropertyName(DatastoreFieldManager.java:1073) at org.datanucleus.store.appengine.DatastoreFieldManager.fetchObjectField(DatastoreFieldManager.java:309) at org.datanucleus.store.appengine.DatastoreFieldManager.fetchLongField(DatastoreFieldManager.java:429) at org.datanucleus.state.AbstractStateManager.replacingLongField(AbstractStateManager.java:1148) at com.grgcomponents.coatl.server.persisted.TwitterOAuthTokens.jdoReplaceField(TwitterOAuthTokens.java) at com.grgcomponents.coatl.server.persisted.TwitterOAuthTokens.jdoReplaceFields(TwitterOAuthTokens.java) at org.datanucleus.state.JDOStateManagerImpl.replaceFields(JDOStateManagerImpl.java:2772) at org.datanucleus.state.JDOStateManagerImpl.replaceFields(JDOStateManagerImpl.java:2791) at org.datanucleus.store.appengine.DatastorePersistenceHandler.fetchObject(DatastorePersistenceHandler.java:480) at org.datanucleus.state.JDOStateManagerImpl.validate(JDOStateManagerImpl.java:4263) at org.datanucleus.ObjectManagerImpl.findObject(ObjectManagerImpl.java:2444) at org.datanucleus.jpa.EntityManagerImpl.find(EntityManagerImpl.java:234) at org.datanucleus.store.appengine.jpa.DatastoreEntityManager.find(DatastoreEntityManager.java:56) at com.grgcomponents.coatl.server.UserUtil.getTwitter(UserUtil.java:40) at com.grgcomponents.coatl.server.UserUtil.getUserSetting(UserUtil.java:62) at com.grgcomponents.coatl.server.preferences.UserSettingsServiceImpl.getSetting(UserSettingsServiceImpl.java:14) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at com.google.appengine.tools.development.agent.runtime.Runtime.invoke(Runtime.java:100) at com.google.gwt.user.server.rpc.RPC.invokeAndEncodeResponse(RPC.java:562) ... 30 more
这是我试图坚持的课程:
package com.grgcomponents.coatl.server.persisted;
import javax.persistence.Entity;
import javax.persistence.Id;
@Entity
public class TwitterOAuthTokens {
@Id
private String loginManagerCookie;
private String requestTokenKey;
private String requestTokenSecret;
private String userToken;
private String userTokenSecret;
private long lastUsed;
public String getLoginManagerCookie() {
return loginManagerCookie;
}
public void setLoginManagerCookie(String loginManagerCookie) {
this.loginManagerCookie = loginManagerCookie;
}
public String getUserToken() {
return userToken;
}
public void setUserToken(String userToken) {
this.userToken = userToken;
}
public String getUserTokenSecret() {
return userTokenSecret;
}
public void setUserTokenSecret(String userTokenSecret) {
this.userTokenSecret = userTokenSecret;
}
public String getRequestTokenKey() {
return requestTokenKey;
}
public void setRequestTokenKey(String requestTokenKey) {
this.requestTokenKey = requestTokenKey;
}
public String getRequestTokenSecret() {
return requestTokenSecret;
}
public void setRequestTokenSecret(String requestTokenSecret) {
this.requestTokenSecret = requestTokenSecret;
}
public long getLastUsed() {
return lastUsed;
}
public void setLastUsed(long lastUsed) {
this.lastUsed = lastUsed;
}
}
这是实际上看起来失败的调用(我们输入getTwitter(String),失败发生在最后一行:
public static Twitter getTwitter( String loginManagerId )
{
if( loginManagerId == null )
return null;
EntityManager em = CoatlEntityManagerFactory.getDefault()
.createEntityManager();
return getTwitter( loginManagerId, em );
}
public static Twitter getTwitter( String loginManagerId, EntityManager em )
{
if( loginManagerId == null )
return null;
TwitterOAuthTokens storedTokens = em.find( TwitterOAuthTokens.class,
loginManagerId );
答案 0 :(得分:1)
这是在任何可持续的类上不时发生的零星错误,但更多的是并行使用的错误。它发生在JDO和JPA中,似乎本地数据存储区锁定了一个特定的表/实体组并忘记释放它;从而导致对ds操作的所有后续调用失败。我一般不用重启eclipse;只是停止然后启动服务器往往会解决问题,如果没有,完全刷新/清理构建将成功。
唯一真正的解决方案似乎是将get()或put()调用放在同步代码块中,理论上,它确保一次只有一个线程访问您的实体。 http://code.google.com/p/datanucleus-appengine/issues/detail?id=203