[jboss-jira] [JBoss JIRA] Updated: (JBMESSAGING-1200) Session.executor is leaking the first classLoader used

Clebert Suconic (JIRA) jira-events at lists.jboss.org
Wed Dec 12 14:35:06 EST 2007


     [ http://jira.jboss.com/jira/browse/JBMESSAGING-1200?page=all ]

Clebert Suconic updated JBMESSAGING-1200:
-----------------------------------------

    Description: 
First time the Session.executor is called, it will initialized a thread.
That thread will assume the parent's contextClassLoader, and it will hold it for the entire life cycle of the executor.

This could be a problem on the application server, as the JCA adapter will cache the session, reusing it between different applications.

When the session is used by another application, the executor's thread will have a reference to the previously used JAR, and ThreadContextClassLoader is used on ObjectInputStream operations. (ObjectInputStreamWithClassLoader).

This pattern will also cause problems when the application is undeployed. When the Session is reused again it will have the reference to an invalid classLoader, what could lead to uncaught exception on the ClientConsumer, what could leave messages in some uncertain condition.

To fix this, we need to set and clear the ContextClassLoader on every invocation.

  was:
First time the Session.executor is called, it will initialized a thread.
That thread will assume the parent's contextClassLoader, and it will hold it for the entire life cycle of the executor.

This could be a problem on the application server, as the JCA adapter will cache the session, reusing it between different applications.

When the session is used by another application, the executor's thread will have a reference to the previously used JAR, and ThreadContextClassLoader is used on ObjectInputStream operations. (ObjectInputStreamWithClassLoader).

This pattern will also cause problems when the application is undeployed. When the Session is reused again it will have the reference to an invalid classLoader, what could lead to uncaught exception on the ClientConsumer, what could leave messages in some uncertain condition.

To fix this, we need to cleanup to set and clear the ContextClassLoader on every invocation.


> Session.executor is leaking the first classLoader used
> ------------------------------------------------------
>
>                 Key: JBMESSAGING-1200
>                 URL: http://jira.jboss.com/jira/browse/JBMESSAGING-1200
>             Project: JBoss Messaging
>          Issue Type: Bug
>    Affects Versions: 1.4.0.SP2
>            Reporter: Clebert Suconic
>         Assigned To: Clebert Suconic
>             Fix For: 1.4.1
>
>
> First time the Session.executor is called, it will initialized a thread.
> That thread will assume the parent's contextClassLoader, and it will hold it for the entire life cycle of the executor.
> This could be a problem on the application server, as the JCA adapter will cache the session, reusing it between different applications.
> When the session is used by another application, the executor's thread will have a reference to the previously used JAR, and ThreadContextClassLoader is used on ObjectInputStream operations. (ObjectInputStreamWithClassLoader).
> This pattern will also cause problems when the application is undeployed. When the Session is reused again it will have the reference to an invalid classLoader, what could lead to uncaught exception on the ClientConsumer, what could leave messages in some uncertain condition.
> To fix this, we need to set and clear the ContextClassLoader on every invocation.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.jboss.com/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        



More information about the jboss-jira mailing list