Log4j 2
  1. Log4j 2
  2. LOG4J2-640

java.lang.NullPointerException cause by NULLThread.currentThread().getContextClassLoader() when logging

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 2.0-rc1
    • Fix Version/s: 2.0-rc2
    • Component/s: Core
    • Labels:
      None
    • Environment:

      Linux,java 1.6

      Description

      EXCEPTION:
      java.lang.NullPointerException
      at org.apache.logging.log4j.core.impl.ThrowableProxy.loadClass(ThrowableProxy.java:468)
      at org.apache.logging.log4j.core.impl.ThrowableProxy.resolvePackageData(ThrowableProxy.java:395)
      at org.apache.logging.log4j.core.impl.ThrowableProxy.<init>(ThrowableProxy.java:97)
      at org.apache.logging.log4j.core.impl.Log4jLogEvent.<init>(Log4jLogEvent.java:114)
      at org.apache.logging.log4j.core.impl.Log4jLogEvent.<init>(Log4jLogEvent.java:90)
      at org.apache.logging.log4j.core.impl.DefaultLogEventFactory.createEvent(DefaultLogEventFactory.java:49)
      at org.apache.logging.log4j.core.config.LoggerConfig.log(LoggerConfig.java:365)
      at org.apache.logging.log4j.core.Logger.log(Logger.java:112)
      at org.apache.logging.log4j.spi.AbstractLogger.error(AbstractLogger.java:605)
      at com.taobao.security.sm.service.manager.SmServiceConfigManager.handleAppConfig(SmServiceConfigManager.java:133)

      SOURCE:
      loadClass() in ThrowableProxy.java:
      clazz = Thread.currentThread().getContextClassLoader().loadClass(className);

      REASON:
      Thread.currentThread().getContextClassLoader() return null to raise NullPointerException.

      pls fix it.

        Activity

        LIUJIAN created issue -
        Matt Sicker made changes -
        Field Original Value New Value
        Assignee Matt Sicker [ jvz ]
        Matt Sicker made changes -
        Status Open [ 1 ] In Progress [ 3 ]
        Hide
        Matt Sicker added a comment -

        This is probably due to the TCCL being null if it's the system classloader. I'm on it.

        Show
        Matt Sicker added a comment - This is probably due to the TCCL being null if it's the system classloader. I'm on it.
        Hide
        Matt Sicker added a comment -

        Added to trunk. Please verify and close.

        Show
        Matt Sicker added a comment - Added to trunk. Please verify and close.
        Matt Sicker made changes -
        Status In Progress [ 3 ] Resolved [ 5 ]
        Fix Version/s 2.0-rc2 [ 12326292 ]
        Resolution Fixed [ 1 ]
        Transition Time In Source Status Execution Times Last Executer Last Execution Date
        Open Open In Progress In Progress
        21d 5h 34m 1 Matt Sicker 06/Jun/14 23:13
        In Progress In Progress Resolved Resolved
        7m 14s 1 Matt Sicker 06/Jun/14 23:21

          People

          • Assignee:
            Matt Sicker
            Reporter:
            LIUJIAN
          • Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development