Hi,
Receiving "A binding to XXX was already configured at YYY" due to
using JerseyServletModule and RequestScopeModule from resteasy.
All the classes that RequestScopeModule binds to a provider are already
being bound in JerseyServletModule while creating the injector. Not
installing RequestScopeModule is not an option with the current code I'm
working with since it enables the objects to be referred using @Context
annotation at runtime (and its a third party).
Code looks like:
@Override
protected Injector getInjector()
{
return Guice.createInjector(new JerseyServletModule()
{
@Override
protected void configureServlets()
{
install(new AbcModule());
//params, filters and other modules
serve("/*").with(GuiceContainer.class, params);
}
});
}
AbcModule.configure:
@Override
protected void configure()
{
install(new RequestScopeModule());
}
Client code uses @Context UriInfo uriInfo; which is always null in case I
do not install RequestScopeModule (since its already bound but not
available in the Context). And installing it gives conflicts on all of the
classes for which the providers are being created when inserting into the
Context of the request.
Is there a way to resolve these conflicts (possibly by removing bindings
from JerseyServletModule() and letting guice rebind those from
RequestScopeModule)?
Thanks
--
You received this message because you are subscribed to the Google Groups
"google-guice" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/google-guice.
To view this discussion on the web visit
https://groups.google.com/d/msgid/google-guice/b8b3eb6f-b24e-43ec-8813-c2d8ca55c01f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.