GWT RequestFactory: SEVERE: No RequestContext for operation 21ta4sO_AJ6TM$y1q6TcANUXPyQ=

Problem

Error message like:

Jan 27, 2012 10:48:51 AM com.google.web.bindery.requestfactory.server.ServiceLayerDecorator dieSEVERE: No RequestContext for operation 21ta4sO_AJ6TM$y1q6TcANUXPyQ=com.google.web.bindery.requestfactory.server.UnexpectedException: No RequestContext for operation 21ta4sO_AJ6TM$y1q6TcANUXPyQ=

Solution


The RequestContext interfaces annotated with the @Service annotation doesn't reflect the exact method signature of the DAOService class. Pay attention that int and Integer resp. boolean and Boolean are not the same!

@ANDREA


You have to re-run the annotation processor.

Also the signature, namely the return type, the parameter types, and the number of parameters have to match exactly the service methods. This is an example that uses the ServiceLocator pattern but should also work for non ServiceLocator using code:

@Service(value = BookingDAOService.class, locator = DAOServiceLocator.class)
public interface BookingRequest extends RequestContext {


    Request<BookingProxy> findBookingForSession(final Integer sessionId);


    Request<List<BookingProxy>> getCanceledBookings();


    Request<UserProxy> getUserOfSession(Integer sessionId);


    Request<Void> markBookingAndSessionAsCanceled(final Integer sessionId, final Integer canceledByUserId);


    Request<Void> createSessionAndBooking(final SessionProxy session, final BookingProxy booking);


    Request<Boolean> isPTSessionBookable(final Integer resourceId, final Date beginTime, final Date endTime);
}

Comments

  1. I've checked in my project...all match....where's the problem??? S.O.S.

    ReplyDelete
  2. Awesome. Thanks.

    The String name of my service (value="...") was not the same as the service class name after a refactoring session. This is not picked up as a build error (!)

    ReplyDelete

Post a Comment

Popular posts from this blog

Tuning ext4 for performance with emphasis on SSD usage

NetBeans 6.1: Working with Google´s Android SDK, Groovy and Grails