struts-user mailing list archives

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


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:
http://jira.opensymphony.com/browse/XW-560 
I also found a reference suggesting this could be a problem with  using the 
deprecated FilterDispatcher rather than a  StrutsPrepareAndExecuteFilter:
https://issues.apache.org/jira/browse/WW-2167
I was originally using Struts 2.1.8.1 and upgraded to the latest  (2.3.1.2) 
which didn't solve the problem, nor did switching back and  forth between the 
FilterDispatcher and StrutsPrepareAndExecuteFilter  (the following is from my 
web.xml):
<filter>     <filter-name>action2</filter-name>         
<filter-class>org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter</filter-class>
 </filter>  <filter-mapping>     <filter-name>httpResponseFilter</filter-name>
    
<url-pattern>/*</url-pattern> </filter-mapping> <filter-mapping> 
   
<filter-name>springSecurityFilterChain</filter-name>     
<url-pattern>/*</url-pattern> </filter-mapping> <filter-mapping> 
   
<filter-name>action2</filter-name>     <url-pattern>/*</url-pattern>

</filter-mapping> 

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


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.
Thanks,
Tom 


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Mime
View raw message