1

私のサービスの多くは、DAOに公開されているだけです。そこで、これらのサービスのインターフェイスを作成しました。

public interface DAORequestContext<T extends SRSProxyBase> extends RequestContext {
    Request<T> find(Long id);

    Request<T> load(Long id);

    Request<T> save(T id);
}

ただし、このインターフェイスを拡張する場合(RequestFactoryにアノテーションなしで):

public interface SafeRideRequestFactory extends RequestFactory {
    public UserService userService();

    @Service(value = UserDAO.class, locator = DAOServiceLocator.class)
    interface UserService extends DAORequestContext<SRSUserProxy> { }
}

ランタイム例外が発生します:

[ERROR] org.saferide.shared.service.DAORequestContext has no mapping to a domain type (e.g. @ProxyFor or @Service)
[ERROR] The type org.saferide.shared.service.DAORequestContext must be annotated with a @Service or @ServiceName annotation
[ERROR] The RequestContext type org.saferide.shared.service.DAORequestContext did not pass validation
[ERROR] Unexpected error
com.google.web.bindery.requestfactory.server.UnexpectedException: The RequestContext type org.saferide.shared.service.DAORequestContext did not pass validation

RequestContextの直接の子孫のみが許可されていますか?誰かがこれに遭遇しましたか?

4

1 に答える 1

1

http://code.google.com/p/google-web-toolkit/issues/detail?id=5807および関連するhttp://code.google.com/p/google-web-toolkit/issues/detail?を参照してください。 id=6234およびhttp://code.google.com/p/google-web-toolkit/issues/detail?id=6035

それは実際にあなたが使用しているGWTのバージョンに依存し、それはまだ改善されています。GWT 2.4がリリースされたときに使用することをお勧めします(さらに、その「検証」は実行時ではなくコンパイル時に行われます)

于 2011-08-28T10:33:02.840 に答える