使用 RequestFactory 和 Objectify 时出现奇怪的异常

发布于 2024-11-07 19:16:03 字数 2435 浏览 0 评论 0原文

我查看了 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

匿名的好友 2024-11-14 19:16:03

您必须注册要与 objectify 一起使用的类。像这样的东西:

factory.register(com.trial.gwtgae.server.domain.Sketch2.class);

You have to register classes that you want to use with objectify. Something like this:

factory.register(com.trial.gwtgae.server.domain.Sketch2.class);
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文