[jboss-jira] [JBoss JIRA] Created: (JBAS-4437) Log4jProxy in commons-logging fork throws NPE if TCCL is null

Brian Stansberry (JIRA) jira-events at lists.jboss.org
Tue May 22 17:16:02 EDT 2007


Log4jProxy in commons-logging fork throws NPE if TCCL is null
-------------------------------------------------------------

                 Key: JBAS-4437
                 URL: http://jira.jboss.com/jira/browse/JBAS-4437
             Project: JBoss Application Server
          Issue Type: Bug
      Security Level: Public (Everyone can see)
          Components: Logging
    Affects Versions: JBossAS-4.2.0.GA, JBossAS-4.0.5.GA
            Reporter: Brian Stansberry
         Assigned To: Scott M Stark


The Log4jProxy class in the JCL fork has this:

ClassLoader loader = Thread.currentThread().getContextClassLoader();
// Validate that TCL can actually see the log4j classes
try
{
   Class levelClass = loader.loadClass("org.apache.log4j.Level");
   ...
}
catch(ClassNotFoundException e)
{
    // No, hack to fall back to this class' class loader
    loader = Log4jProxy.class.getClassLoader();
}

This throws an NPE if the TCCL is null.

On a recent case a finalize() method ended up trying to instantiate a logger; failed because the Finalizer thread didn't have a TCCL set.

-- 
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