Yea you need to call GuiceFilter.destroy() in your test tearDown, to clean
up.
If you are not using the in-code servlet configuration(i.e.
filter().through(), etc.), however, you can safely ignore this warning.

Dhanji.

On Thu, May 21, 2009 at 6:25 AM, Greg Lindholm <[email protected]>wrote:

>
> (I had mentioned this problem as part of my last post but since it
> likely got lost in the unrelated 'bogus' issue I'm posting it again
> separately.)
>
> I've been using Guice 1.0 with Struts 2.1.6 and the struts plugin.
> I just replaced the Guice 1.0 jars with the Guice 2.0 jars:
>
> guice-2.0.jar
> guice-struts2-plugin-2.0.jar
> guice-servlet-2.0.jar
>
> When I run my full set of unit tests I get many of these warnings:
>
> May 20, 2009 1:31:06 PM com.google.inject.servlet.GuiceFilter
> setPipeline
> 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()).
>
> However if I run my tests one at a time I don't get the warnings.  I'm
> running the test from within Eclipse using the (builtin) JUnit
> facility.  If I select a group of test to run by selecting a folder
> with multiple tests then I get a bunch of these warnings. If I run one
> test at a time I have not seen the warning. One folder has 3 tests
> under it, when I run JUnit on this folder I get 2 of these warnings.
> The tests all run correctly (as before with Guice 1.0), I just get
> these warnings.
>
> It appears that some global state thingy is bleeding over between
> tests.
> Is there a cleanup step that is needed after a test is run to prevent
> this?
>
> >
>

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