Nevermind, I figured it out.

The same Module was being shared by two different parent Modules. One
was JerseyServletModule (which was defining a binding for UriInfo).
The other one was a JUnit test scope (that did not define a UriInfo
binding). In other words, Guice is right. My code was not defining the
necessary binding. Sorry for the false alarm.

I figured this out by placing a breakpoint in
FactoryProvider.newFactory() and examining the call stack.

Gili

On Mar 29, 3:44 pm, cowwoc <[email protected]> wrote:
> Hi,
>
> Using Guice 2.0 I am able to @Inject top-level Jersey components whose
> constructor refer to UriInfo, however when I try using AssistedInject
> for constructors referring to UriInfo I get this error:
>
>    No implementation for javax.ws.rs.core.UriInfo was bound.
>
> JerseyServletModule defines the following bindings:
>
>     @Provides
>     @RequestScoped
>     public UriInfo uriInfo(WebApplication wa) {
>         return wa.getThreadLocalHttpContext().getUriInfo();
>     }
>
>     @Provides
>     public WebApplication webApp(GuiceContainer guiceContainer) {
>         return guiceContainer.getWebApplication();
>     }
>
> Why would the two injection types differ? Any ideas?
>
> Thanks,
> Gili

-- 
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