[HAP-489] Build failure due to multiple SLF4J bindings Created: 22/May/14  Updated: 14/Nov/17  Resolved: 02/Jun/14

Status: Resolved
Project: Jenkins Artifactory Plug-in
Component/s: None
Affects Version/s: 2.2.2
Fix Version/s: 2.2.3

Type: Bug Priority: Blocker
Reporter: Steven Brown Assignee: Lior Hasson (Inactive)
Resolution: Fixed Votes: 2
Labels: None
Environment:

Jenkins 1.564
Jenkins Artifactory Plugin 2.2.2
No other plugins (except for those bundled with Jenkins)
Artifactory 3.2.0



 Description   

Set up:
I created a new Maven build and chose the Deploy artifacts to Artifactory post-build action. The workspace contains only a pom.xml with the groudId, artifactId and version elements.

Result:
The builds fail with the following console output.

  • If the artifactory post-build action is deleted, the builds are successful again.
  • If the artifactory plugin is downgraded to 2.2.1, the builds are successful again.

Console Output:

Started by user anonymous
Building in workspace /home/stevengbrown/.jenkins/workspace/artifactory
Parsing POMs
[artifactory] $ java -cp /home/stevengbrown/.jenkins/plugins/maven-plugin/WEB-INF/lib/maven3-agent-1.5.jar:/usr/share/maven/boot/plexus-classworlds-2.x.jar org.jvnet.hudson.maven3.agent.Maven3Main /usr/share/maven /home/stevengbrown/.jenkins/war/WEB-INF/lib/remoting-2.41.jar /home/stevengbrown/.jenkins/plugins/maven-plugin/WEB-INF/lib/maven3-interceptor-1.5.jar /home/stevengbrown/.jenkins/plugins/maven-plugin/WEB-INF/lib/maven3-interceptor-commons-1.5.jar 44944
<===[JENKINS REMOTING CAPACITY]===>channel started
SLF4J: Class path contains multiple SLF4J bindings.
SLF4J: Found binding in [jar:file:/home/stevengbrown/.jenkins/cache/artifactory-plugin/2.2.2/slf4j-jdk14-1.6.2.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [file:/tmp/jenkins-remoting6994418843090034949/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation.
Failed to instantiate SLF4J LoggerFactory
Reported exception:
java.lang.NoClassDefFoundError: org/slf4j/spi/LoggerFactoryBinder
	at java.lang.ClassLoader.defineClass1(Native Method)
	at java.lang.ClassLoader.defineClass(ClassLoader.java:800)
	at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
	at java.net.URLClassLoader.defineClass(URLClassLoader.java:449)
	at java.net.URLClassLoader.access$100(URLClassLoader.java:71)
	at java.net.URLClassLoader$1.run(URLClassLoader.java:361)
	at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
	at java.security.AccessController.doPrivileged(Native Method)
	at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
	at org.codehaus.plexus.classworlds.realm.ClassRealm.loadClassFromSelf(ClassRealm.java:386)
	at org.codehaus.plexus.classworlds.strategy.SelfFirstStrategy.loadClass(SelfFirstStrategy.java:42)
	at org.codehaus.plexus.classworlds.realm.ClassRealm.loadClass(ClassRealm.java:244)
	at org.codehaus.plexus.classworlds.realm.ClassRealm.loadClass(ClassRealm.java:230)
	at org.codehaus.plexus.classworlds.realm.ClassRealm.loadClassFromParent(ClassRealm.java:405)
	at org.codehaus.plexus.classworlds.strategy.SelfFirstStrategy.loadClass(SelfFirstStrategy.java:46)
	at org.codehaus.plexus.classworlds.realm.ClassRealm.loadClass(ClassRealm.java:244)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:412)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:358)
	at org.slf4j.LoggerFactory.bind(LoggerFactory.java:129)
	at org.slf4j.LoggerFactory.performInitialization(LoggerFactory.java:108)
	at org.slf4j.LoggerFactory.getILoggerFactory(LoggerFactory.java:302)
	at org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:276)
	at org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:288)
	at hudson.maven.Maven3Builder$MavenExecutionListener.<init>(Maven3Builder.java:352)
	at hudson.maven.Maven3Builder.call(Maven3Builder.java:114)
	at hudson.maven.Maven3Builder.call(Maven3Builder.java:69)
	at hudson.remoting.UserRequest.perform(UserRequest.java:118)
	at hudson.remoting.UserRequest.perform(UserRequest.java:48)
	at hudson.remoting.Request$2.run(Request.java:328)
	at hudson.remoting.InterceptingExecutorService$1.call(InterceptingExecutorService.java:72)
	at java.util.concurrent.FutureTask.run(FutureTask.java:262)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
	at java.lang.Thread.run(Thread.java:744)
Caused by: java.lang.ClassNotFoundException: org.slf4j.spi.LoggerFactoryBinder
	at org.codehaus.plexus.classworlds.strategy.SelfFirstStrategy.loadClass(SelfFirstStrategy.java:50)
	at org.codehaus.plexus.classworlds.realm.ClassRealm.loadClass(ClassRealm.java:244)
	at org.codehaus.plexus.classworlds.realm.ClassRealm.loadClass(ClassRealm.java:230)
	... 34 more
channel stopped
ERROR: Failed to parse POMs
java.io.IOException: Remote call on Channel to Maven [java, -cp, /home/stevengbrown/.jenkins/plugins/maven-plugin/WEB-INF/lib/maven3-agent-1.5.jar:/usr/share/maven/boot/plexus-classworlds-2.x.jar, org.jvnet.hudson.maven3.agent.Maven3Main, /usr/share/maven, /home/stevengbrown/.jenkins/war/WEB-INF/lib/remoting-2.41.jar, /home/stevengbrown/.jenkins/plugins/maven-plugin/WEB-INF/lib/maven3-interceptor-1.5.jar, /home/stevengbrown/.jenkins/plugins/maven-plugin/WEB-INF/lib/maven3-interceptor-commons-1.5.jar, 44944] failed
	at hudson.remoting.Channel.call(Channel.java:748)
	at hudson.maven.ProcessCache$MavenProcess.call(ProcessCache.java:160)
	at hudson.maven.MavenModuleSetBuild$MavenModuleSetBuildExecution.doRun(MavenModuleSetBuild.java:843)
	at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:518)
	at hudson.model.Run.execute(Run.java:1706)
	at hudson.maven.MavenModuleSetBuild.run(MavenModuleSetBuild.java:529)
	at hudson.model.ResourceController.execute(ResourceController.java:88)
	at hudson.model.Executor.run(Executor.java:231)
Caused by: java.lang.NoClassDefFoundError: org/slf4j/spi/LoggerFactoryBinder
	at java.lang.ClassLoader.defineClass1(Native Method)
	at java.lang.ClassLoader.defineClass(ClassLoader.java:800)
	at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
	at java.net.URLClassLoader.defineClass(URLClassLoader.java:449)
	at java.net.URLClassLoader.access$100(URLClassLoader.java:71)
	at java.net.URLClassLoader$1.run(URLClassLoader.java:361)
	at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
	at java.security.AccessController.doPrivileged(Native Method)
	at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
	at org.codehaus.plexus.classworlds.realm.ClassRealm.loadClassFromSelf(ClassRealm.java:386)
	at org.codehaus.plexus.classworlds.strategy.SelfFirstStrategy.loadClass(SelfFirstStrategy.java:42)
	at org.codehaus.plexus.classworlds.realm.ClassRealm.loadClass(ClassRealm.java:244)
	at org.codehaus.plexus.classworlds.realm.ClassRealm.loadClass(ClassRealm.java:230)
	at org.codehaus.plexus.classworlds.realm.ClassRealm.loadClassFromParent(ClassRealm.java:405)
	at org.codehaus.plexus.classworlds.strategy.SelfFirstStrategy.loadClass(SelfFirstStrategy.java:46)
	at org.codehaus.plexus.classworlds.realm.ClassRealm.loadClass(ClassRealm.java:244)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:412)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:358)
	at org.slf4j.LoggerFactory.bind(LoggerFactory.java:129)
	at org.slf4j.LoggerFactory.performInitialization(LoggerFactory.java:108)
	at org.slf4j.LoggerFactory.getILoggerFactory(LoggerFactory.java:302)
	at org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:276)
	at org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:288)
	at hudson.maven.Maven3Builder$MavenExecutionListener.<init>(Maven3Builder.java:352)
	at hudson.maven.Maven3Builder.call(Maven3Builder.java:114)
	at hudson.maven.Maven3Builder.call(Maven3Builder.java:69)
	at hudson.remoting.UserRequest.perform(UserRequest.java:118)
	at hudson.remoting.UserRequest.perform(UserRequest.java:48)
	at hudson.remoting.Request$2.run(Request.java:328)
	at hudson.remoting.InterceptingExecutorService$1.call(InterceptingExecutorService.java:72)
	at java.util.concurrent.FutureTask.run(FutureTask.java:262)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
	at java.lang.Thread.run(Thread.java:744)
Caused by: java.lang.ClassNotFoundException: org.slf4j.spi.LoggerFactoryBinder
	at org.codehaus.plexus.classworlds.strategy.SelfFirstStrategy.loadClass(SelfFirstStrategy.java:50)
	at org.codehaus.plexus.classworlds.realm.ClassRealm.loadClass(ClassRealm.java:244)
	at org.codehaus.plexus.classworlds.realm.ClassRealm.loadClass(ClassRealm.java:230)
	... 34 more
Finished: FAILURE


 Comments   
Comment by Lior Hasson (Inactive) [ 24/May/14 ]

Sorry for that, apparently we added the SLF4 Package to our plugin by mistake, following the changes in the last release.
Until our next release (suppose to be in the following month), there is workaround for this problem:

Deleting the problematic Jar (slf4j-jdk14-1.6.2.jar), you can find him under %JENKINS_HOME%/cache/artifactory-plugin/2.2.2,
or in the remote slave under jenkins-slave/cache/artifactory-plugin/2.2.2

Comment by Steven Brown [ 12/Jun/14 ]

Confirmed this is fixed in version 2.2.3, thanks.

Generated at Wed Oct 23 01:02:49 UTC 2019 using JIRA 7.6.16#76018-sha1:9ed376192612a49536ac834c64177a0fed6290f5.