2012-01-12 2 views
0

戻り値の型(XXXProxy)のドメインマッピングをドメイン型に解決できなかったため、このメソッドを検証できません@SuppressWarnings( "requestfactory")を追加して閉じます。GWT2.4でロケータとServiceLocatorを使用するといくつかのエラーが発生する

GWT 2.4以降、RequestFactoryインターフェイスは、RequestFactoryサーバーコードまたはJVMベースのクライアントで使用する前に検証する必要があります。このドキュメントでは、これらのインターフェイスを検証するメカニズムについて説明します。

http://code.google.com/p/google-web-toolkit/wiki/RequestFactoryInterfaceValidation

に応じて私が行っているが、プロキシとRequestクラスに若干の誤差が出てきました。そのような :!

Cannot validate this method because the domain mapping for the return type (XXXProxy) could not be resolved to a domain type Add @SuppressWarnings("requestfactory") to dismiss. 
Could not find domain method similar to java.lang.Integer countUsers()。 

ヘルプ私は、エンティティクラス でサービスを実装するために使用して合格したが、ロケータとのServiceLocatorを使用して渡すことはできません。

Mycode:

@ServiceName(value="UserProxy.class", locator="UserServiceLocator.class") 
public interface UserServiceRequest extends RequestContext { 

    Request<Integer> countUsers(); 
    Request<Void> generateUsers(); 
    Request<List<UserProxy>> findAllUsers(); 
    InstanceRequest<UserProxy, Void> persist(); 
    InstanceRequest<UserProxy, Void> remove(); 

} 

@ProxyForName(value = "User.class", locator = "UserLocator.class") 
public interface UserProxy extends EntityProxy { 

    //...setter and getter 

    EntityProxyId<UserProxy> stableId(); 

} 

エラー[サーバー上のメソッドを使用するデバッグ]

com.google.web.bindery.requestfactory.server.RequestFactoryServletのdoPost 严重:予期しないエラー のjava。 lang.RuntimeException:com.geogre.shared.DemoRfLocateRequestFactory RequestFactoryタイプのRequestFactory ValidationToolを実行する必要があります。 com.google.web.bindery.requestfactory.vm.impl.Deobfuscator $ Builder.load(Deobfuscator.j ava:59) com.google.web.bindery.requestfactory.server.ResolverServiceLayer.updateDeobfuscator(ResolverServiceLayer.java:43) (com.google.web.bindery.requestfactory.server.ResolverServiceLayer.resolveRequestFactory(ResolverServiceLayer.java: com.google.web.bindery.requestfactory.server.ServiceLayerDecorator.resolveRequestFactoryでcom.google.web.bindery.requestfactory.server.ServiceLayerDecorator.resolveRequestFactory(ServiceLayerDecorator.java:172) (ServiceLayerDecorator.java:172)における176) sun.reflect.NativeMethodAccessorImpl.invokeでsun.reflect.NativeMethodAccessorImpl.invoke0(ネイティブメソッド) でcom.google.web.bindery.requestfactory.server.ServiceLayerDecorator.resolveRequestFactory(ServiceLayerDecorator.java:172) (不明なソース)で (不明なソース) com.web.bindery.requestfactory.server.ServiceLayerCache.getOrCache(ServiceLayerCache.java: 233) com.google.web.bindery.requestfactory.server.ServiceLayerCache.resolveRequestFactory(ServiceLayerCache.java:198) at com.google.web.bindery.requestfactory.server.SimpleRequestProcessor.process(SimpleRequestProcessor.java:207) at com.google.web.bindery.requestfactory.server.SimpleRequestProcessor.process(SimpleRequestProcessor.java:127) at com.google.web.bindery.requestfactory.server.RequestFactoryServlet.doPost(RequestFactoryServlet.java:133) at javax.servlet.http.HttpServlet.service(HttpServlet.java:637) でjavax.servlet.http.HttpServlet.service(HttpServlet.java:717) at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:487) at org.mortbay.jetty.servlet.ServletHandler。ハンドル(ServletHandler.java:362) at org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:216) at org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:181) at org.mortbay.jetty.handler。ContextHandler.handle(ContextHandler.java:729) at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:405) at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152) at org.mortbay.jetty.handler.RequestLogHandler.handle(RequestLogHandler.java:49) at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152) at org.mortbay.jetty.Server。 org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:505)の ハンドル(Server.java:324) mortbay.jetty.HttpParser.parseNext(HttpParser.java:647) at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:211)org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:395) at org.mortbay.thread.QueuedThreadPool $ PoolThread。実行(QueuedThreadPool.java:488) プラグマ:no-cache キャッシュコントロール:no-cache レスポンスヘッダー コンテンツタイプ:text/html;文字セット= ISO-8859-1 のContent-Length:1420

答えて

2

あなたはいくつかの方法で、誤っ@ServiceNameアノテーションを使用しているように見えます。あなたはクラスリテラルに言及したい場合は、@ServiceNameを使用する場合は、完全なパッケージ名を必要とする

@Service(value=MyServiceType.class, locator=MyServiceLocator.class) 

代わり

@ServiceName(value="com.company.server.MyServiceType", locator="com.company.gwt.MyServiceLocator") 

を@Serviceを使用するのと同じでは@ProxyForのための真であると@ ProxyForName、あなたはまた、間違って使用されているようです。

いずれの場合でも、RequestContextのサービスポイントをプロキシにすることはできません。おそらく、UserProxyではなくUserを指しているはずです。

+0

私が代わりに@Serviceを使用する場合、 『RequestFactory ValidationToolはXXX RequestFactoryタイプのために実行しなければなりません』再構築 –

+0

とエラーが発生した後編集エラー「に似たドメインの方法を見つけることができませんでした」と出てくる –

+0

アノテーションを実行していることを確認してください例えば、@Service(User)UserSericeRequestにpersist()メソッドがある場合、Userはそれを持つ必要があり、ServiceLocatorを使用してはいけません。投稿を更新して、意味のある注釈、それらが参照するサービス、エンティティ、およびその設定で得られる完全なエラーメッセージを持つプロキシとリクエストを更新します。これにより、提案を簡単に提供できます。 –

関連する問題