使用 RequestFactory 和 Objectify 时出现奇怪的异常
我查看了 Google IO gwtgae2011 中的示例并使其正常工作。我尝试向项目添加一些功能,但不断从服务器收到异常(调用了 onFailure 方法),堆栈跟踪是
19:47:36.070 [ERROR] [crowd] Uncaught exception escaped
com.google.web.bindery.event.shared.UmbrellaException: One or more exceptions caught, see full set in UmbrellaException#getCauses
at com.google.web.bindery.requestfactory.shared.impl.AbstractRequestContext$StandardPayloadDialect.processPayload(AbstractRequestContext.java:299)
at com.google.web.bindery.requestfactory.shared.impl.AbstractRequestContext$4.onTransportSuccess(AbstractRequestContext.java:951)
at com.google.web.bindery.requestfactory.gwt.client.DefaultRequestTransport$1.onResponseReceived(DefaultRequestTransport.java:136)
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)
......stacktrace
Caused by: java.lang.RuntimeException: Server Error: No class 'com.trial.gwtgae.server.domain.Sketch2' was registered
at com.google.web.bindery.requestfactory.shared.Receiver.onFailure(Receiver.java:36)
at com.google.web.bindery.requestfactory.shared.impl.AbstractRequest.onFail(AbstractRequest.java:113)
at com.google.web.bindery.requestfactory.shared.impl.AbstractRequestContext$StandardPayloadDialect.processPayload(AbstractRequestContext.java:271)
at com.google.web.bindery.requestfactory.shared.impl.AbstractRequestContext$4.onTransportSuccess(AbstractRequestContext.java:951)
at com.google.web.bindery.requestfactory.gwt.client.DefaultRequestTransport$1.onResponseReceived(DefaultRequestTransport.java:136)
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(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at com.google.gwt.dev.shell.MethodAdaptor.invoke(MethodAdaptor.java:103)
...more stacktrace
我创建了名为 Sketch2 的 Sketch 类的精确克隆,并在 RequestFactory 接口中创建了 SketchDao、SketchProxy 和 SqetchRequest 的克隆。
无论如何都会抛出异常。 (我尝试重新编译、重新启动、清理生成的文件,尝试使用 IDEA - 同样的问题) 有什么想法为什么会发生这种情况吗?
I had a look at the example from Google IO gwtgae2011 and got it working. I tried to add some functionality to the project and was constantly getting exception from server (onFailure method was invoked) and the stacktrace is
19:47:36.070 [ERROR] [crowd] Uncaught exception escaped
com.google.web.bindery.event.shared.UmbrellaException: One or more exceptions caught, see full set in UmbrellaException#getCauses
at com.google.web.bindery.requestfactory.shared.impl.AbstractRequestContext$StandardPayloadDialect.processPayload(AbstractRequestContext.java:299)
at com.google.web.bindery.requestfactory.shared.impl.AbstractRequestContext$4.onTransportSuccess(AbstractRequestContext.java:951)
at com.google.web.bindery.requestfactory.gwt.client.DefaultRequestTransport$1.onResponseReceived(DefaultRequestTransport.java:136)
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)
......stacktrace
Caused by: java.lang.RuntimeException: Server Error: No class 'com.trial.gwtgae.server.domain.Sketch2' was registered
at com.google.web.bindery.requestfactory.shared.Receiver.onFailure(Receiver.java:36)
at com.google.web.bindery.requestfactory.shared.impl.AbstractRequest.onFail(AbstractRequest.java:113)
at com.google.web.bindery.requestfactory.shared.impl.AbstractRequestContext$StandardPayloadDialect.processPayload(AbstractRequestContext.java:271)
at com.google.web.bindery.requestfactory.shared.impl.AbstractRequestContext$4.onTransportSuccess(AbstractRequestContext.java:951)
at com.google.web.bindery.requestfactory.gwt.client.DefaultRequestTransport$1.onResponseReceived(DefaultRequestTransport.java:136)
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(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at com.google.gwt.dev.shell.MethodAdaptor.invoke(MethodAdaptor.java:103)
...more stacktrace
I created exact clone of class Sketch called Sketch2 and created clones of SketchDao, SketchProxy and SqetchRequest in my RequestFactory interface.
Exception is anyway thrown. (I tried to recompile, restart, clean generated files, tried using IDEA - same problem)
Any ideas why this is happening?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您必须注册要与 objectify 一起使用的类。像这样的东西:
You have to register classes that you want to use with objectify. Something like this: