Dear all,

I've been using Guice to serve my RPC requests very successfully,
however I've run into a problem.  When I have a service interface that
extends another interface (see [1]), I get the error "No
implementation for Persist was bound."

I realize the the issue comes from the statement:

    injector.getInstance(req.getMethod().getDeclaringClass())

As this asks for the implementation of the declaring interface, i.e.
Persist, not the sub interface. This is the key statement that gets
Guice managed services in my  "GuiceRemoteServiceServlet", which
extends the GWT RemoteServiceServlet.
I copied this approach from [2].

I'm wondering if anyone knows of a better implementation of a Guice
capable RemoteServiceServlet out there that handles the situation
described here? If not, I wonder if someone could suggest a way round
this please?

Thanks

Will Temperley


[1] Example of interfaces causing problems:

public interface SurveyService extends Persist<Survey, Integer>, RemoteService {
}

public interface Persist<T,I> {
    T update(String sessionKey, T obj) throws SerializationException;
    List<T> delete(String sessionKey, List<I> ids, I parentId);
    List<T> retrieve(String sessionKey, I parentId);
}

[2] http://stuffthathappens.com/blog/2009/09/14/guice-with-gwt/

-- 
You received this message because you are subscribed to the Google Groups 
"google-guice" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/google-guice?hl=en.

Reply via email to