Search code examples
javagwtrequestfactorygwt2

GWT RequestFactory returns object of wrong type


When I make a call to fetch a list of TripImportSummaryProxy objects, I get back a list of: 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);
}

This is all executed via:

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 is just a marker interface that various filter interfaces extend.

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

}

I have about two dozen other requests working and its only failing on this one. I have verified that the server side service is correctly fetching and returning the right data. I have found that the TripImportSummaryLocator class is never instantiated even though it appears to be bound to the proxy type correctly and has a default constructor.


Solution

  • I was using GWT 2.4 rc1 and after upgrading to GWT 2.4 stable I am no longer seeing this problem.