Project: springxd
Issue XD-3686: log4j/log4j-over-slf4j logging issue
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.(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.
Story points: 1