Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-42098

Error when building a Maven project on a swarm node

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved (View Workflow)
    • Priority: Major
    • Resolution: Fixed
    • Component/s: swarm-plugin
    • Labels:
    • Environment:
      Jenkins ver. 2.19.1
      Maven 3.3.9
      Swarm plugin 3.3
    • Similar Issues:

      Description

      Building a Maven project on a node managed by the swarm plugin generates the stack trace at the bottom of this description.

      The part of most interest appears to be this line:

      Caused by: java.lang.LinkageError: loader constraint violation: when resolving method "org.slf4j.impl.StaticLoggerBinder.getLoggerFactory()Lorg/slf4j/ILoggerFactory;" the class loader (instance of org/codehaus/plexus/classworlds/realm/ClassRealm) of the current c    lass, org/slf4j/LoggerFactory, and the class loader (instance of org/codehaus/plexus/classworlds/realm/ClassRealm) for resolved class, org/slf4j/impl/StaticLoggerBinder, have different Class objects for the type LoggerFactory; used in the signature
      

      I noticed that this commit - f3a9b57cdeb986703f8cefc49b0c208f5e846efc - introduced org.slf4j.jcl-over-slf4j:1.7.22, whereas Maven itself uses version 1.7.5 (https://github.com/apache/maven/blob/maven-3.3.9/pom.xml#L65)

      The Maven plugin lists that package as an exclusion, presumably because of the fragility they mention and because it's provided from elsewhere: https://github.com/jenkinsci/maven-plugin/blob/9807ed59d2f4c15c17485589fca5dd0d5fde3741/pom.xml#L393-L396

      Note that non-Maven builds work just fine.

      $ java -Xmx1024m -cp /var/lib/jenkins/maven32-agent.jar:/var/lib/jenkins/tools/hudson.tasks.Maven_MavenInstallation/Maven_3.2.2/boot/plexus-classworlds-2.5.1.jar:/var/lib/jenkins/tools/hudson.tasks.Maven_MavenInstallation/Maven_3.2.2/conf/logging jenkins.maven3.agent.Maven32Main /var/lib/jenkins/tools/hudson.tasks.Maven_MavenInstallation/Maven_3.2.2 /usr/local/bin/swarm-plugin.jar /var/lib/jenkins/maven32-interceptor.jar /var/lib/jenkins/maven3-interceptor-commons.jar 38918
      <===[JENKINS REMOTING CAPACITY]===>channel started
      ERROR: Failed to parse POMs
      java.io.IOException: Remote call on Channel to Maven [java, -Xmx1024m, -cp, /var/lib/jenkins/maven32-agent.jar:/var/lib/jenkins/tools/hudson.tasks.Maven_MavenInstallation/Maven_3.2.2/boot/plexus-classworlds-2.5.1.jar:/var/lib/jenkins/tools/hudson.tasks.Maven_MavenInstallation/Maven_3.2.2/conf/logging, jenkins.maven3.agent.Maven32Main, /var/lib/jenkins/tools/hudson.tasks.Maven_MavenInstallation/Maven_3.2.2, /usr/local/bin/swarm-plugin.jar, /var/lib/jenkins/maven32-interceptor.jar, /var/lib/jenkins/maven3-interceptor-commons.jar, 38918] failed
      	at hudson.remoting.Channel.call(Channel.java:805)
      	at hudson.maven.ProcessCache$MavenProcess.call(ProcessCache.java:161)
      	at hudson.maven.MavenModuleSetBuild$MavenModuleSetBuildExecution.doRun(MavenModuleSetBuild.java:873)
      	at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:534)
      	at hudson.model.Run.execute(Run.java:1720)
      	at hudson.maven.MavenModuleSetBuild.run(MavenModuleSetBuild.java:544)
      	at hudson.model.ResourceController.execute(ResourceController.java:98)
      	at hudson.model.Executor.run(Executor.java:404)
      Caused by: java.lang.LinkageError: loader constraint violation: when resolving method "org.slf4j.impl.StaticLoggerBinder.getLoggerFactory()Lorg/slf4j/ILoggerFactory;" the class loader (instance of org/codehaus/plexus/classworlds/realm/ClassRealm) of the current class, org/slf4j/LoggerFactory, and the class loader (instance of org/codehaus/plexus/classworlds/realm/ClassRealm) for resolved class, org/slf4j/impl/StaticLoggerBinder, have different Class objects for the type LoggerFactory; used in the signature
      	at org.slf4j.LoggerFactory.getILoggerFactory(LoggerFactory.java:306)
      	at org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:276)
      	at org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:288)
      	at hudson.maven.Maven3Builder$MavenExecutionListener.<init>(Maven3Builder.java:343)
      	at hudson.maven.Maven3Builder$JenkinsEventSpy.<init>(Maven3Builder.java:195)
      	at hudson.maven.Maven3Builder.call(Maven3Builder.java:113)
      	at hudson.maven.Maven3Builder.call(Maven3Builder.java:68)
      	at hudson.remoting.UserRequest.perform(UserRequest.java:153)
      	at hudson.remoting.UserRequest.perform(UserRequest.java:50)
      	at hudson.remoting.Request$2.run(Request.java:336)
      	at hudson.remoting.InterceptingExecutorService$1.call(InterceptingExecutorService.java:68)
      	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:745)
      	at ......remote call to Channel to Maven [java, -Xmx1024m, -cp, /var/lib/jenkins/maven32-agent.jar:/var/lib/jenkins/tools/hudson.tasks.Maven_MavenInstallation/Maven_3.2.2/boot/plexus-classworlds-2.5.1.jar:/var/lib/jenkins/tools/hudson.tasks.Maven_MavenInstallation/Maven_3.2.2/conf/logging, jenkins.maven3.agent.Maven32Main, /var/lib/jenkins/tools/hudson.tasks.Maven_MavenInstallation/Maven_3.2.2, /usr/local/bin/swarm-plugin.jar, /var/lib/jenkins/maven32-interceptor.jar, /var/lib/jenkins/maven3-interceptor-commons.jar, 38918](Native Method)
      	at hudson.remoting.Channel.attachCallSiteStackTrace(Channel.java:1433)
      	at hudson.remoting.UserResponse.retrieve(UserRequest.java:253)
      	at hudson.remoting.Channel.call(Channel.java:797)
      	... 7 more
      channel stopped
      

        Attachments

          Issue Links

            Activity

            grahamlyons Graham Lyons created issue -
            akom Alexander Komarov made changes -
            Field Original Value New Value
            Link This issue is duplicated by JENKINS-42898 [ JENKINS-42898 ]
            grahamlyons Graham Lyons made changes -
            Assignee Kohsuke Kawaguchi [ kohsuke ] Peter Jönsson [ mindjiver ]
            oleg_nenashev Oleg Nenashev made changes -
            Status Open [ 1 ] Resolved [ 5 ]
            Resolution Fixed [ 1 ]

              People

              • Assignee:
                mindjiver Peter J├Ânsson
                Reporter:
                grahamlyons Graham Lyons
              • Votes:
                8 Vote for this issue
                Watchers:
                20 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: