I also get a boat-load of these ThreadLocal errors when I stop my app (using Tomcat 6). Tomcat 6 & 7 are now checking and reporting on all the debris that gets left behind when an app shuts down.
I don't think the WW-560 addresses this problem. If I understand it correctly the problem is when the app shuts down it is failing to cleanup some ThreadLocal variables. To fix this issue something would need to keep track of these variables and remove them when the app terminates. It also means it would need to either be notified about the shutdown or explicitly called to cleanup during shutdown. Since these are ThreadLocal it could be a tricky problem. On Tue, Mar 6, 2012 at 11:57 AM, Tom K <tkim...@yahoo.com> wrote: > 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-unsubscr...@struts.apache.org > For additional commands, e-mail: user-h...@struts.apache.org > >