I found the problem and a solution. The problem has to do with how Guice
does JIT bindings with child injectors. It's actually the Parent binder
that does the binding. Normally this isn't an issue but the Jersey-Guice
code injects the Injector. It's important that that Injector is the child
injector and not the parent injector. You can get this to happen by
explicitly binding the GuiceContainer class (i.e. don't wait on JIT).
return new JerseyServletModule() {
@Override
protected void configureServlets()
{
serve(path).with(GuiceContainer.class);
// this is the important part - it will cause Jersey to get
the child injector
binder().bind(GuiceContainer.class).asEagerSingleton();
}
};
--
You received this message because you are subscribed to the Google Groups
"google-guice" group.
To view this discussion on the web visit
https://groups.google.com/d/msg/google-guice/-/RxQEoNfhvMUJ.
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.