struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Tom K <>
Subject Help with problem: ThreadLocal left after stopping tomcat
Date Tue, 06 Mar 2012 16:57:28 GMT

When stopping or undeploying my struts 2 web app in Tomcat (7.0.23) I get 
several severe warnings from tomcat:
SEVERE: The web application [/myapp] created a ThreadLocal with key  of type 
[com.opensymphony.xwork2.inject.ContainerImpl$10] (value  
[com.opensymphony.xwork2.inject.ContainerImpl$10@1376afa]) and a value  of type 
[java.lang.Object[]] (value [[Ljava.lang.Object;@15075f9]) but  failed to remove 
it when the web application was stopped. Threads are  going to be renewed over 
time to try and avoid a probable memory leak.

I've hunted all over the web and found this error repeated in several  places, 
but I haven't yet found a solution. I then found some posts  that lead me to 
believe this was a problem in the xwork libs but that it  had been resolved in 
the latest version: 
I also found a reference suggesting this could be a problem with  using the 
deprecated FilterDispatcher rather than a  StrutsPrepareAndExecuteFilter:
I was originally using Struts and upgraded to the latest  ( 
which didn't solve the problem, nor did switching back and  forth between the 
FilterDispatcher and StrutsPrepareAndExecuteFilter  (the following is from my 
<filter>     <filter-name>action2</filter-name>         
 </filter>  <filter-mapping>     <filter-name>httpResponseFilter</filter-name>
<url-pattern>/*</url-pattern> </filter-mapping> <filter-mapping> 
<url-pattern>/*</url-pattern> </filter-mapping> <filter-mapping> 
<filter-name>action2</filter-name>     <url-pattern>/*</url-pattern>


I also tried an IntrospectorCleanupListener as a shot in the dark but to no 

If I comment out the StrutsPrepareAndExecuteFilter and deploy/stop  the web app, 
the severe warnings regarding ThreadLocal's go away (though  obviously my web 
app no longer works).

At this point I'm not sure what else to try - is there some  additional cleanup 
I can perform via a ContextLoaderListener or  otherwise on struts to shut it 
down properly when the web app is  stopped? Or are there still bugs in struts 
2/xwork causing this issue  that  haven't been resolved? 

Any suggestions or help much appreciated.

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message