Uploaded image for project: 'Application Server 3  4  5 and 6'
  1. Application Server 3 4 5 and 6
  2. JBAS-4437

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

    XMLWordPrintable

Details

    • Bug
    • Resolution: Obsolete
    • Major
    • No Release
    • JBossAS-4.0.5.GA, JBossAS-4.2.0.GA
    • Logging
    • None

    Description

      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.

      Attachments

        Activity

          People

            starksm64 Scott Stark (Inactive)
            bstansbe@redhat.com Brian Stansberry
            Votes:
            1 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: