You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@activemq.apache.org by "Claus Ibsen (JIRA)" <ji...@apache.org> on 2012/08/30 19:09:10 UTC

[jira] [Created] (AMQ-4008) Tomcat WARN on shutdown about ThreadLocal not cleared from log4j

Claus Ibsen created AMQ-4008:
--------------------------------

             Summary: Tomcat WARN on shutdown about ThreadLocal not cleared from log4j
                 Key: AMQ-4008
                 URL: https://issues.apache.org/jira/browse/AMQ-4008
             Project: ActiveMQ
          Issue Type: Improvement
          Components: Broker
    Affects Versions: 5.6.0
            Reporter: Claus Ibsen
            Assignee: Claus Ibsen
            Priority: Minor
             Fix For: 5.7.0


SEVERE: The web application [/camel-example-activemq-tomcat] created a ThreadLocal with key of type [org.apache.log4j.helpers.ThreadLocalMap] (value [org.apache.log4j.helpers.ThreadLocalMap@1eb0cd0]) and a value of type [java.util.Hashtable] (value [{activemq.broker=myBroker}]) 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 got a bit annoyed by this when I was working on a new example for Apache Camel with an embedded AMQ broker. So I am digging into fixing this. Its in the start() method.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (AMQ-4008) Tomcat WARN on shutdown about ThreadLocal not cleared from log4j

Posted by "Claus Ibsen (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/AMQ-4008?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13445779#comment-13445779 ] 

Claus Ibsen commented on AMQ-4008:
----------------------------------

After digging for a while, its due to MDC being inherited by child threads, eg Log4j code
{code}
ThreadLocalMap extends InheritableThreadLocal
{code}

We don't have a way to control this, the issue is JMX that does all kind of crap causing MDC leaks, as we cannot tell the **** to not inheirt, or to clear the MDC when threads is terminated.
                
> Tomcat WARN on shutdown about ThreadLocal not cleared from log4j
> ----------------------------------------------------------------
>
>                 Key: AMQ-4008
>                 URL: https://issues.apache.org/jira/browse/AMQ-4008
>             Project: ActiveMQ
>          Issue Type: Improvement
>          Components: Broker
>    Affects Versions: 5.6.0
>            Reporter: Claus Ibsen
>            Assignee: Claus Ibsen
>            Priority: Minor
>             Fix For: 5.7.0
>
>
> SEVERE: The web application [/camel-example-activemq-tomcat] created a ThreadLocal with key of type [org.apache.log4j.helpers.ThreadLocalMap] (value [org.apache.log4j.helpers.ThreadLocalMap@1eb0cd0]) and a value of type [java.util.Hashtable] (value [{activemq.broker=myBroker}]) 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 got a bit annoyed by this when I was working on a new example for Apache Camel with an embedded AMQ broker. So I am digging into fixing this. Its in the start() method.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Resolved] (AMQ-4008) Tomcat WARN on shutdown about ThreadLocal not cleared from log4j

Posted by "Claus Ibsen (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/AMQ-4008?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Claus Ibsen resolved AMQ-4008.
------------------------------

    Resolution: Fixed

Closing this ticket as the task issue is already logged in AMQ-3451
                
> Tomcat WARN on shutdown about ThreadLocal not cleared from log4j
> ----------------------------------------------------------------
>
>                 Key: AMQ-4008
>                 URL: https://issues.apache.org/jira/browse/AMQ-4008
>             Project: ActiveMQ
>          Issue Type: Improvement
>          Components: Broker
>    Affects Versions: 5.6.0
>            Reporter: Claus Ibsen
>            Assignee: Claus Ibsen
>            Priority: Minor
>             Fix For: 5.7.0
>
>
> SEVERE: The web application [/camel-example-activemq-tomcat] created a ThreadLocal with key of type [org.apache.log4j.helpers.ThreadLocalMap] (value [org.apache.log4j.helpers.ThreadLocalMap@1eb0cd0]) and a value of type [java.util.Hashtable] (value [{activemq.broker=myBroker}]) 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 got a bit annoyed by this when I was working on a new example for Apache Camel with an embedded AMQ broker. So I am digging into fixing this. Its in the start() method.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (AMQ-4008) Tomcat WARN on shutdown about ThreadLocal not cleared from log4j

Posted by "Claus Ibsen (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/AMQ-4008?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13445836#comment-13445836 ] 

Claus Ibsen commented on AMQ-4008:
----------------------------------

Thanks Gary

Yeah seems Claudio is on top of this.

There is another issue though with restarting an app in Tomcat, is that the JMX connector seems to not close down properly, causing port to be use on reload.

2012-08-31 13:05:24,461 [JMX connector  ] WARN  ManagementContext              - Failed to start jmx connector: Cannot bind to URL [rmi://localhost:1099/jmxrmi]: javax.naming.ServiceUnavailableException [Root exception is java.rmi.ConnectException: Connection refused to host: localhost; nested exception is: 
	java.net.ConnectException: Connection refused]
                
> Tomcat WARN on shutdown about ThreadLocal not cleared from log4j
> ----------------------------------------------------------------
>
>                 Key: AMQ-4008
>                 URL: https://issues.apache.org/jira/browse/AMQ-4008
>             Project: ActiveMQ
>          Issue Type: Improvement
>          Components: Broker
>    Affects Versions: 5.6.0
>            Reporter: Claus Ibsen
>            Assignee: Claus Ibsen
>            Priority: Minor
>             Fix For: 5.7.0
>
>
> SEVERE: The web application [/camel-example-activemq-tomcat] created a ThreadLocal with key of type [org.apache.log4j.helpers.ThreadLocalMap] (value [org.apache.log4j.helpers.ThreadLocalMap@1eb0cd0]) and a value of type [java.util.Hashtable] (value [{activemq.broker=myBroker}]) 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 got a bit annoyed by this when I was working on a new example for Apache Camel with an embedded AMQ broker. So I am digging into fixing this. Its in the start() method.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (AMQ-4008) Tomcat WARN on shutdown about ThreadLocal not cleared from log4j

Posted by "Claus Ibsen (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/AMQ-4008?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13445787#comment-13445787 ] 

Claus Ibsen commented on AMQ-4008:
----------------------------------

Fixed the MDC leak reported by Tomcat. 

Now hunting another issue when embedding Camel together and routing messages

Aug 31, 2012 11:13:35 AM org.apache.catalina.loader.WebappClassLoader clearReferencesThreads
SEVERE: The web application [/camel-example-activemq-tomcat] appears to have started a thread named [ActiveMQ Task-1] but has failed to stop it. This is very likely to create a memory leak.
                
> Tomcat WARN on shutdown about ThreadLocal not cleared from log4j
> ----------------------------------------------------------------
>
>                 Key: AMQ-4008
>                 URL: https://issues.apache.org/jira/browse/AMQ-4008
>             Project: ActiveMQ
>          Issue Type: Improvement
>          Components: Broker
>    Affects Versions: 5.6.0
>            Reporter: Claus Ibsen
>            Assignee: Claus Ibsen
>            Priority: Minor
>             Fix For: 5.7.0
>
>
> SEVERE: The web application [/camel-example-activemq-tomcat] created a ThreadLocal with key of type [org.apache.log4j.helpers.ThreadLocalMap] (value [org.apache.log4j.helpers.ThreadLocalMap@1eb0cd0]) and a value of type [java.util.Hashtable] (value [{activemq.broker=myBroker}]) 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 got a bit annoyed by this when I was working on a new example for Apache Camel with an embedded AMQ broker. So I am digging into fixing this. Its in the start() method.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (AMQ-4008) Tomcat WARN on shutdown about ThreadLocal not cleared from log4j

Posted by "Gary Tully (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/AMQ-4008?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13445829#comment-13445829 ] 

Gary Tully commented on AMQ-4008:
---------------------------------

have a peek at the discussion in https://issues.apache.org/jira/browse/AMQ-3451 w.r.t the active threads.
                
> Tomcat WARN on shutdown about ThreadLocal not cleared from log4j
> ----------------------------------------------------------------
>
>                 Key: AMQ-4008
>                 URL: https://issues.apache.org/jira/browse/AMQ-4008
>             Project: ActiveMQ
>          Issue Type: Improvement
>          Components: Broker
>    Affects Versions: 5.6.0
>            Reporter: Claus Ibsen
>            Assignee: Claus Ibsen
>            Priority: Minor
>             Fix For: 5.7.0
>
>
> SEVERE: The web application [/camel-example-activemq-tomcat] created a ThreadLocal with key of type [org.apache.log4j.helpers.ThreadLocalMap] (value [org.apache.log4j.helpers.ThreadLocalMap@1eb0cd0]) and a value of type [java.util.Hashtable] (value [{activemq.broker=myBroker}]) 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 got a bit annoyed by this when I was working on a new example for Apache Camel with an embedded AMQ broker. So I am digging into fixing this. Its in the start() method.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (AMQ-4008) Tomcat WARN on shutdown about ThreadLocal not cleared from log4j

Posted by "Claus Ibsen (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/AMQ-4008?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13445956#comment-13445956 ] 

Claus Ibsen commented on AMQ-4008:
----------------------------------

Okay got the JMX issue resolved now.
                
> Tomcat WARN on shutdown about ThreadLocal not cleared from log4j
> ----------------------------------------------------------------
>
>                 Key: AMQ-4008
>                 URL: https://issues.apache.org/jira/browse/AMQ-4008
>             Project: ActiveMQ
>          Issue Type: Improvement
>          Components: Broker
>    Affects Versions: 5.6.0
>            Reporter: Claus Ibsen
>            Assignee: Claus Ibsen
>            Priority: Minor
>             Fix For: 5.7.0
>
>
> SEVERE: The web application [/camel-example-activemq-tomcat] created a ThreadLocal with key of type [org.apache.log4j.helpers.ThreadLocalMap] (value [org.apache.log4j.helpers.ThreadLocalMap@1eb0cd0]) and a value of type [java.util.Hashtable] (value [{activemq.broker=myBroker}]) 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 got a bit annoyed by this when I was working on a new example for Apache Camel with an embedded AMQ broker. So I am digging into fixing this. Its in the start() method.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira