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

        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.

          People

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

            Dates

            • Created:
              Updated:
              Resolved:

              Development