Hey guys.  I have been converting a non-DI web-app to using Guice, and
have noticed the warning:

"Multiple injectors detected. Please install only one ServletModule in
your web application. While you may have more than one injector, you
should only configure guice-servlet in one of them. (Hint: look for
legacy ServetModules or multiple calls to Servlets.configure())"

Digging into the source a little bit, it appears as if this was caused
by us using Modules.combine() and Modules.override() to compose our
modules, instead of simply listing our ServletModules in the
Guice.createInjector() call.  Besides that, we are using the
recommended pattern of a single GuiceServletContextListener, with one
Guice.createInjector() call.

My questions are:

- Should we really listen to the warning and only have one
ServletModule?  Or should we be trying to keep our modules small and
simple?
- Most importantly, is this really going to cause a problem? Or can we
safely ignore the warning?

Thanks for an excellent DI framework.

Jason

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