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

LogConfigurationException due to conflicting commons-logging versions

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Critical Critical
    • swarm-plugin
    • None
    • LTS 1.565.1

      We run a Maven type job using Jenkins version 1.565.1.
      When building on master, the job builds fine.
      When using a swarm client, the job fails with the following error shown in the console log:

      ...
      	at org.kohsuke.stapler.Stapler.<clinit>(Stapler.java:1062)
      	... 51 more
      Caused by: org.apache.commons.logging.LogConfigurationException: org.apache.commons.logging.LogConfigurationException: Invalid class loader hierarchy.  You have more than one version of 'org.apache.commons.logging.Log' visible, which is not allowed. (Caused by org.apache.commons.logging.LogConfigurationException: Invalid class loader hierarchy.  You have more than one version of 'org.apache.commons.logging.Log' visible, which is not allowed.)
      	at org.apache.commons.logging.impl.LogFactoryImpl.getLogConstructor(LogFactoryImpl.java:397)
      	at org.apache.commons.logging.impl.LogFactoryImpl.newInstance(LogFactoryImpl.java:529)
      	... 56 more
      Caused by: org.apache.commons.logging.LogConfigurationException: Invalid class loader hierarchy.  You have more than one version of 'org.apache.commons.logging.Log' visible, which is not allowed.
      	at org.apache.commons.logging.impl.LogFactoryImpl.getLogConstructor(LogFactoryImpl.java:385)
      	... 57 more
      channel stopped
      

          [JENKINS-24149] LogConfigurationException due to conflicting commons-logging versions

          Is this still an issue with latest version?

          Peter Jönsson added a comment - Is this still an issue with latest version?

          Rene Kok added a comment -

          This is still an issue with Jenkins LTS version 1.565.3 and Swarm plugin 1.19

          Rene Kok added a comment - This is still an issue with Jenkins LTS version 1.565.3 and Swarm plugin 1.19

          I'm experiencing a similar problem with version 1.590. The plug-in I'm using depends on guice-4.0-beta5 and 'com.google.' packages are masked off (using <maskClasses> in the maven-hpi-plugin). Works fine on the master but on a slave it crashes because it uses guice-4.0-beta - no_aop (provided by jenkins-core).

          Could it be that the <maskClasses> directive isn't propagated correctly to the swarm client?

          Thomas Hallgren added a comment - I'm experiencing a similar problem with version 1.590. The plug-in I'm using depends on guice-4.0-beta5 and 'com.google.' packages are masked off (using <maskClasses> in the maven-hpi-plugin). Works fine on the master but on a slave it crashes because it uses guice-4.0-beta - no_aop (provided by jenkins-core). Could it be that the <maskClasses> directive isn't propagated correctly to the swarm client?

          Same problem here with jenkins-swarm 1.22 & Jenkins 1.599.
          Did not manage to apply the workaround with those versions.

          Guillaume Théraud added a comment - Same problem here with jenkins-swarm 1.22 & Jenkins 1.599. Did not manage to apply the workaround with those versions.

          I was able to workaround it by using commons-loggins-1.1.1 in the swarm-client jar.

          It seems that that is the version jenkins itself is using.

          For the maven build to work I added

          <dependency>
                      <groupId>commons-logging</groupId>
                      <artifactId>commons-logging</artifactId>
                      <version>1.1.1</version>
                  </dependency>

          to the swarm-client pom.xml and the resulting artifact worked correctly on my case.

          Gustavo Lucena Dalmaso added a comment - I was able to workaround it by using commons-loggins-1.1.1 in the swarm-client jar. It seems that that is the version jenkins itself is using. For the maven build to work I added <dependency> <groupId> commons-logging </groupId> <artifactId> commons-logging </artifactId> <version> 1.1.1 </version> </dependency> to the swarm-client pom.xml and the resulting artifact worked correctly on my case.

          gldalmaso Your patch works for me. I already created pull request https://github.com/jenkinsci/swarm-plugin/pull/24.

          Dawid Malinowski added a comment - gldalmaso Your patch works for me. I already created pull request https://github.com/jenkinsci/swarm-plugin/pull/24 .

          Code changed in jenkins
          User: Dawid Malinowski
          Path:
          client/pom.xml
          http://jenkins-ci.org/commit/swarm-plugin/849e550491366260cc7f8e6b831c7a51155f6982
          Log:
          JENKINS-24149 - LogConfigurationException due to conflicting commons-logging versions

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Dawid Malinowski Path: client/pom.xml http://jenkins-ci.org/commit/swarm-plugin/849e550491366260cc7f8e6b831c7a51155f6982 Log: JENKINS-24149 - LogConfigurationException due to conflicting commons-logging versions

          Code changed in jenkins
          User: Peter Jönsson
          Path:
          client/pom.xml
          http://jenkins-ci.org/commit/swarm-plugin/6aaf9453d44a46db3600485cbaba73288c4c960e
          Log:
          Merge pull request #24 from oberthur/master

          JENKINS-24149 - LogConfigurationException

          Compare: https://github.com/jenkinsci/swarm-plugin/compare/704dd97a434b...6aaf9453d44a

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Peter Jönsson Path: client/pom.xml http://jenkins-ci.org/commit/swarm-plugin/6aaf9453d44a46db3600485cbaba73288c4c960e Log: Merge pull request #24 from oberthur/master JENKINS-24149 - LogConfigurationException Compare: https://github.com/jenkinsci/swarm-plugin/compare/704dd97a434b...6aaf9453d44a

          Released in swarm-plugin-1.23

          Peter Jönsson added a comment - Released in swarm-plugin-1.23

          Dan Alvizu added a comment -

          I had a different stacktrace for this issue, if it helps anyone else diagnose the issue. Upgrading to 1.23 fixed the issue.

          My stacktrace occured trying to run a FileCallable on the remote slave:

          java.io.IOException: remote file operation failed: [...]: java.io.InvalidClassException: org.apache.commons.logging.LogConfigurationException; local class incompatible: stream classdesc serialVersionUID = 1571584275865309127, local class serialVersionUID = 8486587136871052495
          	at hudson.FilePath.act(FilePath.java:985)
          	at hudson.FilePath.act(FilePath.java:967)
          	at com.[my_publisher]perform([...my_publisher...].java:105)
          	at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:20)
          	at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:776)
          	at hudson.model.AbstractBuild$AbstractBuildExecution.performAllBuildSteps(AbstractBuild.java:723)
          	at hudson.model.Build$BuildExecution.post2(Build.java:183)
          	at hudson.model.AbstractBuild$AbstractBuildExecution.post(AbstractBuild.java:670)
          	at hudson.model.Run.execute(Run.java:1763)
          	at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
          	at hudson.model.ResourceController.execute(ResourceController.java:98)
          	at hudson.model.Executor.run(Executor.java:381)
          Caused by: java.io.InvalidClassException: org.apache.commons.logging.LogConfigurationException; local class incompatible: stream classdesc serialVersionUID = 1571584275865309127, local class serialVersionUID = 8486587136871052495
          	at java.io.ObjectStreamClass.initNonProxy(ObjectStreamClass.java:617)
          	at java.io.ObjectInputStream.readNonProxyDesc(ObjectInputStream.java:1622)
          	at java.io.ObjectInputStream.readClassDesc(ObjectInputStream.java:1517)
          	at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1771)
          	at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1350)
          	at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:1990)
          	at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1915)
          	at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1798)
          	at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1350)
          	at java.io.ObjectInputStream.readObject(ObjectInputStream.java:370)
          	at hudson.remoting.UserRequest.deserialize(UserRequest.java:185)
          	at hudson.remoting.UserResponse.retrieve(UserRequest.java:218)
          	at hudson.remoting.Channel.call(Channel.java:753)
          	at hudson.FilePath.act(FilePath.java:978)
          

          Dan Alvizu added a comment - I had a different stacktrace for this issue, if it helps anyone else diagnose the issue. Upgrading to 1.23 fixed the issue. My stacktrace occured trying to run a FileCallable on the remote slave: java.io.IOException: remote file operation failed: [...]: java.io.InvalidClassException: org.apache.commons.logging.LogConfigurationException; local class incompatible: stream classdesc serialVersionUID = 1571584275865309127, local class serialVersionUID = 8486587136871052495 at hudson.FilePath.act(FilePath.java:985) at hudson.FilePath.act(FilePath.java:967) at com.[my_publisher]perform([...my_publisher...].java:105) at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:20) at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:776) at hudson.model.AbstractBuild$AbstractBuildExecution.performAllBuildSteps(AbstractBuild.java:723) at hudson.model.Build$BuildExecution.post2(Build.java:183) at hudson.model.AbstractBuild$AbstractBuildExecution.post(AbstractBuild.java:670) at hudson.model.Run.execute(Run.java:1763) at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43) at hudson.model.ResourceController.execute(ResourceController.java:98) at hudson.model.Executor.run(Executor.java:381) Caused by: java.io.InvalidClassException: org.apache.commons.logging.LogConfigurationException; local class incompatible: stream classdesc serialVersionUID = 1571584275865309127, local class serialVersionUID = 8486587136871052495 at java.io.ObjectStreamClass.initNonProxy(ObjectStreamClass.java:617) at java.io.ObjectInputStream.readNonProxyDesc(ObjectInputStream.java:1622) at java.io.ObjectInputStream.readClassDesc(ObjectInputStream.java:1517) at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1771) at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1350) at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:1990) at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1915) at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1798) at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1350) at java.io.ObjectInputStream.readObject(ObjectInputStream.java:370) at hudson.remoting.UserRequest.deserialize(UserRequest.java:185) at hudson.remoting.UserResponse.retrieve(UserRequest.java:218) at hudson.remoting.Channel.call(Channel.java:753) at hudson.FilePath.act(FilePath.java:978)

            mindjiver Peter Jönsson
            rkok Rene Kok
            Votes:
            0 Vote for this issue
            Watchers:
            9 Start watching this issue

              Created:
              Updated:
              Resolved: