GWT RequestFactory返回错误类型的对象

时间:2012-01-22 21:08:37

标签: java gwt requestfactory gwt2

当我打电话来获取TripImportSummaryProxy个对象的列表时,我得到一个列表: com.schedgy.core.dao.filter.proxy.FilterProxyAutoBean_com_google_web_bindery_requestfactory_shared_impl_EntityProxyCategory_com_google_web_bindery_requestfactory_shared_impl_ValueProxyCategory_com_google_web_bindery_requestfactory_shared_impl_BaseProxyCategory

@ProxyFor(value=TripImportSummary.class, locator=TripImportSummaryLocator.class)
public interface TripImportSummaryProxy extends MyBaseProxy {
    // some setter/getters defined here
}

public interface TripImportSummaryRequestFactory extends RequestFactory, HasPaginationRequest<TripImportSummaryProxy> {
    TripImportSummaryRequest request();
}

@Service(value=TripImportSummaryService.class, locator=MyServiceLocator.class)
public interface TripImportSummaryRequest extends RequestContext, PaginationRequest<TripImportSummaryProxy> {

}

@SkipInterfaceValidation
public interface HasPaginationRequest<T> extends RequestFactory {
    PaginationRequest<T> request();
}

@ExtraTypes(FilterProxy.class)
@SkipInterfaceValidation
public interface PaginationRequest<T> extends RequestContext {

    Request<List<T>> paginate(int offset, int limit, String sortColumn,
            boolean isSortAscending, List<FilterProxy> filters);

    Request<Integer> count(List<FilterProxy> list);
}

这一切都是通过以下方式执行的:

PaginationRequest<TripImportSummaryProxy> request = requestFactory.request();
request.paginate(offset, limit, sortColumn, isSortAscending, getFilters(request)).with(getPaths()).fire(new MyReceiver<List<TripImportSummaryProxy>>() {

    @Override
    public void onSuccess(List<TripImportSummaryProxy> response) {
        // Response is a list of type that seems to extend from FilterProxy
    }
});

FilterProxy只是各种过滤器接口扩展的标记接口。

@ProxyFor(Object.class)
public interface FilterProxy extends ValueProxy {

}

我还有大约24个其他请求正在运行,而且只有这个请求失败了。我已经验证服务器端服务正确获取并返回正确的数据。我发现TripImportSummaryLocator类从未实例化,即使它似乎正确绑定到代理类型并具有默认构造函数。

1 个答案:

答案 0 :(得分:0)

我使用的是GWT 2.4 rc1,升级到GWT 2.4后,我不再看到这个问题了。