我查看了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 - 同样的问题) 任何想法为什么会发生这种情况?
答案 0 :(得分:1)
您必须注册要与objectify一起使用的类。像这样:
factory.register(com.trial.gwtgae.server.domain.Sketch2.class);