2011-08-28 122 views
1

我的許多服務都暴露了DAO的。因此,我創建了這些服務的接口:是否支持使用GWT RequestFactory支持RequestContext的接口?

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的直接後代?有沒有人遇到過這個?

回答