2

GWT 2.4 brings service inheritance on the client (issue 6234, issue 6035).

I've been waiting for this future for a long time, as it saves a lot of duplicated code on the client. I've started implementing it, but so for with mixed success.

This is my code:

public interface BaseEntityRequest<T>
{
    Request<Void> put(T entity);
    Request<List<T>> getAllOrderBy(String propertyName);
    Request<List<T>> getRangeAndFilter(int limit,int offset, QueryInfoProxy queryInfo);
}

@Service(value = EgdDao.class, locator = DaoServiceLocator.class)
public interface EgdRequest extends RequestContext, BaseEntityRequest<EgdProxy>
{
    Request<Void> exportToExcel(QueryInfoProxy queryInfo, String userName);
}

So far getAllOrderBy and getRangeAndFilter work fine, but put(T entity) does not.

I get the following error in the console:

[ERROR] Unexpected error
java.util.NoSuchElementException

and this gets returned in the receiver onFailure ServerFailure message:

Error 500 INTERNAL_SERVER_ERROR
HTTP ERROR 500
Problem accessing /gwtRequest. Reason:
INTERNAL_SERVER_ERROR

The only cause, that I can see, for the put method not to work, when the others do, is that it uses the generic parameter T. When I move the put method in the EgdRequest interface (using EgdProxy as a parameter instead of T) it starts to work, so I know my server code is fine.

Does anybody have any idea how to implement this correctly?

Thanks!

3
  • Hey. How did You solve this. I know that a lot time passed, but maybe You could help me? I am trying to make generic proxy and context for the client side code. Commented Nov 27, 2015 at 11:52
  • Hi, sorry, but I was never actually able to fix the issue. I donțt know if the bug has been solved in the meantime or not, as I no longer use GWT: Commented Dec 15, 2016 at 13:30
  • I've also gave up on request factory. I use rest now Commented Dec 15, 2016 at 18:40

1 Answer 1

5

It's a GWT bug. See http://code.google.com/p/google-web-toolkit/issues/detail?id=6794

Sign up to request clarification or add additional context in comments.

1 Comment

Thanks! Hope it gets fixed soon :).

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.