Struts 2
  1. Struts 2
  2. WW-3772

Struts 2, Thread Locals reported by Tomcat after web application is stopped

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Duplicate
    • Affects Version/s: 2.1.8.1, 2.2.3.1, 2.3.1.2
    • Fix Version/s: 2.3.3
    • Component/s: Dispatch Filter, Other
    • Labels:
    • Environment:

      Windows 7, Struts 2.1.8.1/2.2.3.1/2.2.1.3, Spring 3.0.1

      Description

      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.

      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 ThreadLocals go away (though obviously my web app no longer works).

      I sought further advice on the Struts 2 user mailing list as well as a couple web forums but didn't get any further suggestions other than to file a bug on JIRA.

      It seems at least a few others are experiencing the same issue. From my experimentation it seems something related to the StrutsPrepareAndExecuteFilter starts off threads on startup but they are not shut down properly. I could not find any documentation on additional cleanup I might perform to force any threads started by struts to shutdown.

        Issue Links

          Activity

          Tom Kimzey created issue -
          Tom Kimzey made changes -
          Field Original Value New Value
          Description 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.

          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 ThreadLocals go away (though obviously my web app no longer works).

          I sought further advice on the Struts 2 user mailing list as well as a couple web forums but didn't get any further suggestions other than to file a bug on JIRA.

          It seems at least a few others are experiencing the same issue. From my experimentation it seems something related to the StrutsPrepareAndExecuteFilter starts off threads on startup but they are not shut down properly. I could not find any documentation on additional cleanup I might perform force any threads started by struts to shutdown.





          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.

          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 ThreadLocals go away (though obviously my web app no longer works).

          I sought further advice on the Struts 2 user mailing list as well as a couple web forums but didn't get any further suggestions other than to file a bug on JIRA.

          It seems at least a few others are experiencing the same issue. From my experimentation it seems something related to the StrutsPrepareAndExecuteFilter starts off threads on startup but they are not shut down properly. I could not find any documentation on additional cleanup I might perform to force any threads started by struts to shutdown.





          Rene Gielen made changes -
          Link This issue duplicates WW-3768 [ WW-3768 ]
          Hide
          Rene Gielen added a comment -

          Please check the linked issue WW-3768

          Show
          Rene Gielen added a comment - Please check the linked issue WW-3768
          Rene Gielen made changes -
          Status Open [ 1 ] Resolved [ 5 ]
          Assignee Rene Gielen [ rgielen ]
          Fix Version/s 2.3.2 [ 12319199 ]
          Resolution Duplicate [ 3 ]
          Lukasz Lenart made changes -
          Fix Version/s 2.3.3 [ 12320642 ]
          Fix Version/s 2.3.2 [ 12319199 ]
          Lukasz Lenart made changes -
          Status Resolved [ 5 ] Closed [ 6 ]

            People

            • Assignee:
              Rene Gielen
              Reporter:
              Tom Kimzey
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development