2012-01-27

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);
}