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

All Maven 2 builds fail with java.lang.NoSuchMethodError DigestUtils.md5Hex

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Blocker Blocker
    • maven-plugin
    • Linux, IBM JDK6 and Sun JDK6

      All our Jenkins builds using Maven2 are failing after upgrade to 1.517. Reverting back to 1.516 solves the issue. Our Maven 3 based builds are not affected.

      [INFO] ------------------------------------------------------------------------
      [ERROR] FATAL ERROR
      [INFO] ------------------------------------------------------------------------
      [INFO] org/apache/commons/codec/digest/DigestUtils.md5Hex(Ljava/io/InputStream;)Ljava/lang/String;
      [INFO] ------------------------------------------------------------------------
      [INFO] Trace
      java.lang.NoSuchMethodError: org/apache/commons/codec/digest/DigestUtils.md5Hex(Ljava/io/InputStream;)Ljava/lang/String;
      at hudson.Util.getDigestOf(Util.java:557)
      at hudson.maven.reporters.MavenArtifactArchiver.postBuild(MavenArtifactArchiver.java:101)
      at hudson.maven.Maven2Builder.postModule(Maven2Builder.java:129)
      at hudson.maven.MavenBuilder$Adapter.fireLeaveModule(MavenBuilder.java:354)
      at hudson.maven.MavenBuilder$Adapter.postBuild(MavenBuilder.java:308)
      at org.apache.maven.lifecycle.LifecycleExecutorInterceptor.execute(LifecycleExecutorInterceptor.java:68)
      at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:328)
      at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:138)
      at org.apache.maven.cli.MavenCli.main(MavenCli.java:362)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:60)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:37)
      at java.lang.reflect.Method.invoke(Method.java:611)
      at org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315)
      at org.codehaus.classworlds.Launcher.launch(Launcher.java:255)
      at hudson.maven.agent.Main.launch(Main.java:185)
      at hudson.maven.MavenBuilder.call(MavenBuilder.java:154)
      at hudson.maven.Maven2Builder.call(Maven2Builder.java:79)
      at hudson.maven.Maven2Builder.call(Maven2Builder.java:55)
      at hudson.remoting.UserRequest.perform(UserRequest.java:118)
      at hudson.remoting.UserRequest.perform(UserRequest.java:48)
      at hudson.remoting.Request$2.run(Request.java:326)
      at hudson.remoting.InterceptingExecutorService$1.call(InterceptingExecutorService.java:72)
      at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:314)
      at java.util.concurrent.FutureTask.run(FutureTask.java:149)
      at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:897)
      at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:919)
      at java.lang.Thread.run(Thread.java:738)
      [INFO] ------------------------------------------------------------------------
      [INFO] Total time: 8 seconds
      [INFO] Finished at: Mon Jun 03 15:26:42 CEST 2013
      [INFO] Final Memory: 49M/125M
      [INFO] ------------------------------------------------------------------------
      channel stopped
      Finished: FAILURE

          [JENKINS-18178] All Maven 2 builds fail with java.lang.NoSuchMethodError DigestUtils.md5Hex

          Jesse Glick added a comment -

          Presumably https://github.com/jenkinsci/jenkins/commit/51fbd2d8675fb3703ce38d935e661abf03e1b83b caused this: somehow the Maven runner is trying to link to its own obsolete copy of DigestUtils, i.e. a class loading issue.

          Jesse Glick added a comment - Presumably https://github.com/jenkinsci/jenkins/commit/51fbd2d8675fb3703ce38d935e661abf03e1b83b caused this: somehow the Maven runner is trying to link to its own obsolete copy of DigestUtils , i.e. a class loading issue.

          Jesse Glick added a comment -

          I was not able to reproduce this using Jenkins 1.517 or 1.524-SNAPSHOT, with Jenkins running on (Oracle) JDK 7, and a native Maven project using JDK 6 and Maven 2.2.1. Is there something I am missing—steps to reproduce?

          Jesse Glick added a comment - I was not able to reproduce this using Jenkins 1.517 or 1.524-SNAPSHOT, with Jenkins running on (Oracle) JDK 7, and a native Maven project using JDK 6 and Maven 2.2.1. Is there something I am missing—steps to reproduce?

          joseph nelson added a comment -

          We are seeing this bug on our jenkins instance. It does NOT appear to cause build failure with all Maven 2.2.1 POMs, only one project of several is having this issue after upgrading to Jenkins versions >1.517

          joseph nelson added a comment - We are seeing this bug on our jenkins instance. It does NOT appear to cause build failure with all Maven 2.2.1 POMs, only one project of several is having this issue after upgrading to Jenkins versions >1.517

          joseph nelson added a comment - - edited

          Throwing this out there as a possible cause:

          I turned on verbose logging for Maven and noticed the following:

          02:31:33 [Loaded org.apache.commons.codec.digest.DigestUtils from file:/home/builduser/.m2/repository/commons-codec/commons-codec/1.2/commons-codec-1.2.jar]

          When I looked up that package's javadocs for the the md5Hex method, I see:
          (http://commons.apache.org/proper/commons-codec/apidocs/org/apache/commons/codec/digest/DigestUtils.html#md5Hex(java.io.InputStream)
          md5Hex
          public static String md5Hex(InputStream data)
          throws IOException
          Calculates the MD5 digest and returns the value as a 32 character hex string.
          Parameters:
          data - Data to digest
          Returns:
          MD5 digest as a hex string
          Throws:
          IOException - On error reading from the stream
          Since:
          1.4

          That this method only exists since 1.4 version of this JAR and it appears to be using 1.2 is a good canidate for this?

          joseph nelson added a comment - - edited Throwing this out there as a possible cause: I turned on verbose logging for Maven and noticed the following: 02:31:33 [Loaded org.apache.commons.codec.digest.DigestUtils from file:/home/builduser/.m2/repository/commons-codec/commons-codec/1.2/commons-codec-1.2.jar] When I looked up that package's javadocs for the the md5Hex method, I see: ( http://commons.apache.org/proper/commons-codec/apidocs/org/apache/commons/codec/digest/DigestUtils.html#md5Hex(java.io.InputStream ) md5Hex public static String md5Hex(InputStream data) throws IOException Calculates the MD5 digest and returns the value as a 32 character hex string. Parameters: data - Data to digest Returns: MD5 digest as a hex string Throws: IOException - On error reading from the stream Since: 1.4 That this method only exists since 1.4 version of this JAR and it appears to be using 1.2 is a good canidate for this?

          joseph nelson added a comment -

          Isolated it to this:

          <extensions>
          <extension>
          <groupId>org.springframework.build.aws</groupId>
          <artifactId>org.springframework.build.aws.maven</artifactId>
          <version>3.0.0.RELEASE</version>
          </extension>
          </extensions>

          If I remove that extension, the error goes away.

          joseph nelson added a comment - Isolated it to this: <extensions> <extension> <groupId>org.springframework.build.aws</groupId> <artifactId>org.springframework.build.aws.maven</artifactId> <version>3.0.0.RELEASE</version> </extension> </extensions> If I remove that extension, the error goes away.

          Jesse Glick added a comment -

          Bingo, that is what I needed to reproduce. Thanks @josephnelson!

          Jesse Glick added a comment - Bingo, that is what I needed to reproduce. Thanks @josephnelson!

          Code changed in jenkins
          User: Jesse Glick
          Path:
          changelog.html
          core/src/main/java/hudson/Util.java
          test/src/test/java/hudson/maven/MavenBuildTest.java
          http://jenkins-ci.org/commit/jenkins/e0a3a1ddf5fa08e80a94a565dd05c39f76de6e93
          Log:
          [FIXED JENKINS-18178] Reverting an inessential part of the fix of JENKINS-16301 since it broke some Maven builds.
          Apparently the Maven 2 process factory fails to adequately insulate the Maven process from Jenkins library dependencies;
          if you specify a build extension that can override dependencies used by Jenkins core classes!
          A real fix would involve changing class loader delegation, since presumably similar bugs could still occur.

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Jesse Glick Path: changelog.html core/src/main/java/hudson/Util.java test/src/test/java/hudson/maven/MavenBuildTest.java http://jenkins-ci.org/commit/jenkins/e0a3a1ddf5fa08e80a94a565dd05c39f76de6e93 Log: [FIXED JENKINS-18178] Reverting an inessential part of the fix of JENKINS-16301 since it broke some Maven builds. Apparently the Maven 2 process factory fails to adequately insulate the Maven process from Jenkins library dependencies; if you specify a build extension that can override dependencies used by Jenkins core classes! A real fix would involve changing class loader delegation, since presumably similar bugs could still occur.

          dogfood added a comment -

          Integrated in jenkins_main_trunk #2748
          [FIXED JENKINS-18178] Reverting an inessential part of the fix of JENKINS-16301 since it broke some Maven builds. (Revision e0a3a1ddf5fa08e80a94a565dd05c39f76de6e93)

          Result = SUCCESS
          Jesse Glick : e0a3a1ddf5fa08e80a94a565dd05c39f76de6e93
          Files :

          • core/src/main/java/hudson/Util.java
          • changelog.html
          • test/src/test/java/hudson/maven/MavenBuildTest.java

          dogfood added a comment - Integrated in jenkins_main_trunk #2748 [FIXED JENKINS-18178] Reverting an inessential part of the fix of JENKINS-16301 since it broke some Maven builds. (Revision e0a3a1ddf5fa08e80a94a565dd05c39f76de6e93) Result = SUCCESS Jesse Glick : e0a3a1ddf5fa08e80a94a565dd05c39f76de6e93 Files : core/src/main/java/hudson/Util.java changelog.html test/src/test/java/hudson/maven/MavenBuildTest.java

            jglick Jesse Glick
            gsash Georg Sash
            Votes:
            2 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved: