java.lang.NoClassDefFoundError: org/apache/log4j/spi/ThrowableInformation

Spring JIRA | Janne Valkealahti | 1 year ago
tip
Your exception is missing from the Samebug knowledge base.
Here are the best solutions we found on the Internet.
Click on the to mark the helpful solution and get rewards for you help.
  1. 0

    I got below error when executing modules on yarn and it was written in appmaster stderr output. {code} Exception in thread "Thread-2" java.lang.NoClassDefFoundError: org/apache/log4j/spi/ThrowableInformation at org.apache.log4j.spi.LoggingEvent.<init>(LoggingEvent.java:165) at org.apache.log4j.Category.forcedLog(Category.java:391) at org.apache.log4j.Category.log(Category.java:856) at org.slf4j.impl.Log4jLoggerAdapter.log(Log4jLoggerAdapter.java:595) at org.apache.commons.logging.impl.SLF4JLocationAwareLog.warn(SLF4JLocationAwareLog.java:192) at org.springframework.context.support.AbstractApplicationContext.doClose(AbstractApplicationContext.java:969) at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.doClose(EmbeddedWebApplicationContext.java:150) at org.springframework.context.support.AbstractApplicationContext$1.run(AbstractApplicationContext.java:893) {code} `LoggingEvent` is found from both `log4j-over-slf4j-1.7.12.jar` and `log4j-1.2.17.jar`. I suppose it depends on which one is used first to load this class. Here's what we have in admin and appmaster jar files(spring-cloud-dataflow-yarn-build-tests is my local new sub-project to run tests on a hadoop minicluster): {code} unzip -l target/spring-cloud-dataflow-yarn-build-tests/spring-cloud-dataflow-yarn-appmaster-1.0.0.BUILD-SNAPSHOT.jar|grep jar|grep -i log 62050 2013-05-16 22:04 lib/commons-logging-1.1.3.jar 489884 2012-05-06 13:24 lib/log4j-1.2.17.jar 8860 2015-03-26 21:56 lib/slf4j-log4j12-1.7.12.jar 2234 2015-09-03 16:30 lib/spring-boot-starter-logging-1.3.0.M5.jar 24567 2015-03-26 21:57 lib/log4j-over-slf4j-1.7.12.jar 40824 2015-08-18 12:39 lib/tomcat-embed-logging-juli-8.0.26.jar 66802 2015-05-28 09:49 lib/jboss-logging-3.3.0.Final.jar {code} {code} unzip -l spring-cloud-dataflow-admin/target/spring-cloud-dataflow-admin-1.0.0.BUILD-SNAPSHOT.jar |grep jar|grep -i log 62050 2013-05-16 22:04 lib/commons-logging-1.1.3.jar 489884 2012-05-06 13:24 lib/log4j-1.2.17.jar 40824 2015-08-18 12:39 lib/tomcat-embed-logging-juli-8.0.26.jar 66802 2015-05-28 09:49 lib/jboss-logging-3.3.0.Final.jar 2234 2015-09-03 16:30 lib/spring-boot-starter-logging-1.3.0.M5.jar 280928 2015-03-24 12:06 lib/logback-classic-1.1.3.jar 455041 2015-03-24 12:05 lib/logback-core-1.1.3.jar 24567 2015-03-26 21:57 lib/log4j-over-slf4j-1.7.12.jar {code} Error went away when I removed `log4j-over-slf4j-1.7.12.jar` from maven deps for yarn appmaster jar. I suppose we have same issue with admin server.

    Spring JIRA | 1 year ago | Janne Valkealahti
    java.lang.NoClassDefFoundError: org/apache/log4j/spi/ThrowableInformation
  2. 0

    I got below error when executing modules on yarn and it was written in appmaster stderr output. {code} Exception in thread "Thread-2" java.lang.NoClassDefFoundError: org/apache/log4j/spi/ThrowableInformation at org.apache.log4j.spi.LoggingEvent.<init>(LoggingEvent.java:165) at org.apache.log4j.Category.forcedLog(Category.java:391) at org.apache.log4j.Category.log(Category.java:856) at org.slf4j.impl.Log4jLoggerAdapter.log(Log4jLoggerAdapter.java:595) at org.apache.commons.logging.impl.SLF4JLocationAwareLog.warn(SLF4JLocationAwareLog.java:192) at org.springframework.context.support.AbstractApplicationContext.doClose(AbstractApplicationContext.java:969) at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.doClose(EmbeddedWebApplicationContext.java:150) at org.springframework.context.support.AbstractApplicationContext$1.run(AbstractApplicationContext.java:893) {code} `LoggingEvent` is found from both `log4j-over-slf4j-1.7.12.jar` and `log4j-1.2.17.jar`. I suppose it depends on which one is used first to load this class. Here's what we have in admin and appmaster jar files(spring-cloud-dataflow-yarn-build-tests is my local new sub-project to run tests on a hadoop minicluster): {code} unzip -l target/spring-cloud-dataflow-yarn-build-tests/spring-cloud-dataflow-yarn-appmaster-1.0.0.BUILD-SNAPSHOT.jar|grep jar|grep -i log 62050 2013-05-16 22:04 lib/commons-logging-1.1.3.jar 489884 2012-05-06 13:24 lib/log4j-1.2.17.jar 8860 2015-03-26 21:56 lib/slf4j-log4j12-1.7.12.jar 2234 2015-09-03 16:30 lib/spring-boot-starter-logging-1.3.0.M5.jar 24567 2015-03-26 21:57 lib/log4j-over-slf4j-1.7.12.jar 40824 2015-08-18 12:39 lib/tomcat-embed-logging-juli-8.0.26.jar 66802 2015-05-28 09:49 lib/jboss-logging-3.3.0.Final.jar {code} {code} unzip -l spring-cloud-dataflow-admin/target/spring-cloud-dataflow-admin-1.0.0.BUILD-SNAPSHOT.jar |grep jar|grep -i log 62050 2013-05-16 22:04 lib/commons-logging-1.1.3.jar 489884 2012-05-06 13:24 lib/log4j-1.2.17.jar 40824 2015-08-18 12:39 lib/tomcat-embed-logging-juli-8.0.26.jar 66802 2015-05-28 09:49 lib/jboss-logging-3.3.0.Final.jar 2234 2015-09-03 16:30 lib/spring-boot-starter-logging-1.3.0.M5.jar 280928 2015-03-24 12:06 lib/logback-classic-1.1.3.jar 455041 2015-03-24 12:05 lib/logback-core-1.1.3.jar 24567 2015-03-26 21:57 lib/log4j-over-slf4j-1.7.12.jar {code} Error went away when I removed `log4j-over-slf4j-1.7.12.jar` from maven deps for yarn appmaster jar. I suppose we have same issue with admin server.

    Spring JIRA | 1 year ago | Janne Valkealahti
    java.lang.NoClassDefFoundError: org/apache/log4j/spi/ThrowableInformation
  3. 0

    Spring MVC Initialization Causes Log4J Exception

    Stack Overflow | 5 years ago | Jason
    java.lang.NoClassDefFoundError: org/apache/log4j/spi/ThrowableInformation at org.apache.log4j.spi.LoggingEvent.&lt;init&gt;(LoggingEvent.java:165)
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    Varying ClassNotFoundException on various Log4j classes

    Stack Overflow | 2 years ago | Adam
    java.lang.NoClassDefFoundError: org/apache/log4j/spi/ThrowableInformation
  6. 0

    Share Make Public | Alfresco Add-ons - Alfresco Customizations

    alfresco.com | 1 year ago
    java.lang.NoClassDefFoundError: org/apache/log4j/spi/ThrowableInformation

    2 unregistered visitors
    Not finding the right solution?
    Take a tour to get the most out of Samebug.

    Tired of useless tips?

    Automated exception search integrated into your IDE

    Root Cause Analysis

    1. java.lang.NoClassDefFoundError

      org/apache/log4j/spi/ThrowableInformation

      at org.apache.log4j.spi.LoggingEvent.<init>()
    2. Apache Log4j
      Category.log
      1. org.apache.log4j.spi.LoggingEvent.<init>(LoggingEvent.java:165)
      2. org.apache.log4j.Category.forcedLog(Category.java:391)
      3. org.apache.log4j.Category.log(Category.java:856)
      3 frames
    3. SLF4J LOG4J-12 Binding
      Log4jLoggerAdapter.log
      1. org.slf4j.impl.Log4jLoggerAdapter.log(Log4jLoggerAdapter.java:595)
      1 frame
    4. Apache Commons Logging
      SLF4JLocationAwareLog.warn
      1. org.apache.commons.logging.impl.SLF4JLocationAwareLog.warn(SLF4JLocationAwareLog.java:192)
      1 frame
    5. Spring Context
      AbstractApplicationContext.doClose
      1. org.springframework.context.support.AbstractApplicationContext.doClose(AbstractApplicationContext.java:969)
      1 frame
    6. Spring Boot
      EmbeddedWebApplicationContext.doClose
      1. org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.doClose(EmbeddedWebApplicationContext.java:150)
      1 frame
    7. Spring Context
      AbstractApplicationContext$1.run
      1. org.springframework.context.support.AbstractApplicationContext$1.run(AbstractApplicationContext.java:893)
      1 frame