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

NullPointerException when an incremental build is triggered

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Critical Critical
    • maven-plugin
    • None
    • debian

      Whenever an incremental build is triggered, I have the following stack trace.
      This happens since I have upgraded to 1.379.
      I upgraded because of JENKINS-5357.

      My root pom is found, and the module list seems correct ; no idea where this NullPointerException comes from.


      Un changement dans la base de code a provoqué le lancement de ce job
      Building on master
      Updating https://svn.petalslink.com/svnroot/trunk/infra/hudson
      At revision 2395
      Updating https://svn.petalslink.com/svnroot/trunk/cooking
      U easywsdl/easywsdl11-api/src/test/java/com/ebmwebsourcing/easywsdl11/api/TestConstants.java
      At revision 2395
      no change for https://svn.petalslink.com/svnroot/trunk/infra/hudson since the previous build
      Parsing POMs
      ERROR: Processing failed due to a bug in the code. Please report this to users@hudson.dev.java.net
      java.lang.NullPointerException
      at java.lang.String.startsWith(String.java:1421)
      at java.lang.String.startsWith(String.java:1450)
      at hudson.maven.MavenModuleSetBuild$1.isDescendantOf(MavenModuleSetBuild.java:178)
      at hudson.maven.MavenModuleSetBuild$1.<init>(MavenModuleSetBuild.java:147)
      at hudson.maven.MavenModuleSetBuild.getChangeSetFor(MavenModuleSetBuild.java:141)
      at hudson.maven.MavenModuleSetBuild$RunnerImpl.doRun(MavenModuleSetBuild.java:423)
      at hudson.model.AbstractBuild$AbstractRunner.run(AbstractBuild.java:416)
      at hudson.model.Run.run(Run.java:1280)
      at hudson.maven.MavenModuleSetBuild.run(MavenModuleSetBuild.java:293)
      at hudson.model.ResourceController.execute(ResourceController.java:88)
      at hudson.model.Executor.run(Executor.java:137)
      project=hudson.maven.MavenModuleSet@114441e[EBMWS_trunk_cooking_Linux]
      project.getModules()=[hudson.maven.MavenModule@be8464[EBMWS_trunk_cooking_Linux/com.ebmwebsourcing:cooking-rootbuilder], hudson.maven.MavenModule@1e5d207[EBMWS_trunk_cooking_Linux/com.ebmwebsourcing.easybox:easybox-api], hudson.maven.MavenModule@13fe849[EBMWS_trunk_cooking_Linux/com.ebmwebsourcing.easybox:easybox-api-parent], hudson.maven.MavenModule@ab48a7[EBMWS_trunk_cooking_Linux/com.ebmwebsourcing.easybox:easybox-cli], hudson.maven.MavenModule@12f0ce9[EBMWS_trunk_cooking_Linux/com.ebmwebsourcing.easybox:easybox-impl], hudson.maven.MavenModule@1f8a4fd[EBMWS_trunk_cooking_Linux/com.ebmwebsourcing.easybox:easybox-impl-parent], hudson.maven.MavenModule@11803fb[EBMWS_trunk_cooking_Linux/com.ebmwebsourcing.easybox:easybox-rootbuilder], hudson.maven.MavenModule@1ad8690[EBMWS_trunk_cooking_Linux/com.ebmwebsourcing.easycommons:easycommons-logger], hudson.maven.MavenModule@15d7792[EBMWS_trunk_cooking_Linux/com.ebmwebsourcing.easycommons:easycommons-rootbuilder], hudson.maven.MavenModule@168f44a[EBMWS_trunk_cooking_Linux/com.ebmwebsourcing.easycommons:easycommons-uri], hudson.maven.MavenModule@15538e5[EBMWS_trunk_cooking_Linux/com.ebmwebsourcing.easycommons:easycommons-xml], hudson.maven.MavenModule@a765c[EBMWS_trunk_cooking_Linux/com.ebmwebsourcing.easyschema:easyschema-rootbuilder], hudson.maven.MavenModule@e0b1d6[EBMWS_trunk_cooking_Linux/com.ebmwebsourcing.easyschema:easyschema10-api], hudson.maven.MavenModule@1bb6976[EBMWS_trunk_cooking_Linux/com.ebmwebsourcing.easyschema:easyschema10-cli], hudson.maven.MavenModule@109037d[EBMWS_trunk_cooking_Linux/com.ebmwebsourcing.easyschema:easyschema10-impl], hudson.maven.MavenModule@c4396a[EBMWS_trunk_cooking_Linux/com.ebmwebsourcing.easywsdl:easywsdl-rootbuilder], hudson.maven.MavenModule@95868c[EBMWS_trunk_cooking_Linux/com.ebmwebsourcing.easywsdl:easywsdl11-api], hudson.maven.MavenModule@b46c4c[EBMWS_trunk_cooking_Linux/com.ebmwebsourcing.easywsdl:easywsdl11-impl], hudson.maven.MavenModule@13214d1[EBMWS_trunk_cooking_Linux/com.ebmwebsourcing.escad:escad-rootbuilder], hudson.maven.MavenModule@f4b65d[EBMWS_trunk_cooking_Linux/com.ebmwebsourcing.escad:escad10-api], hudson.maven.MavenModule@1f0c45f[EBMWS_trunk_cooking_Linux/com.ebmwebsourcing.escad:escad10-impl], hudson.maven.MavenModule@1ec4333[EBMWS_trunk_cooking_Linux/com.ebmwebsourcing.esqml:esqml-rootbuilder], hudson.maven.MavenModule@2fdbb1[EBMWS_trunk_cooking_Linux/com.ebmwebsourcing.esqml:esqml10-api], hudson.maven.MavenModule@78f4[EBMWS_trunk_cooking_Linux/com.ebmwebsourcing.esqml:esqml10-impl], hudson.maven.MavenModule@104f8eb[EBMWS_trunk_cooking_Linux/com.ebmwebsourcing.wsaddressing:ws-addressing-rootbuilder], hudson.maven.MavenModule@1724852[EBMWS_trunk_cooking_Linux/com.ebmwebsourcing.wsaddressing:wsaddressing10-api], hudson.maven.MavenModule@1ea0c8b[EBMWS_trunk_cooking_Linux/com.ebmwebsourcing.wsaddressing:wsaddressing10-impl], hudson.maven.MavenModule@dd8904[EBMWS_trunk_cooking_Linux/com.ebmwebsourcing.wsagreement:ws-agreement-rootbuilder], hudson.maven.MavenModule@4e9f7f[EBMWS_trunk_cooking_Linux/com.ebmwebsourcing.wsagreement:wsagreement10-api], hudson.maven.MavenModule@1c97c3e[EBMWS_trunk_cooking_Linux/com.ebmwebsourcing.wsagreement:wsagreement10-impl], hudson.maven.MavenModule@fbf04a[EBMWS_trunk_cooking_Linux/com.ebmwebsourcing.wscap:wscap-rootbuilder], hudson.maven.MavenModule@5cb0bb[EBMWS_trunk_cooking_Linux/com.ebmwebsourcing.wscap:wscap12-api], hudson.maven.MavenModule@156f770[EBMWS_trunk_cooking_Linux/com.ebmwebsourcing.wscap:wscap12-impl]]
      project.getRootModule()=hudson.maven.MavenModule@be8464[EBMWS_trunk_cooking_Linux/com.ebmwebsourcing:cooking-rootbuilder]
      FATAL: null
      java.lang.NullPointerException
      at java.lang.String.startsWith(String.java:1421)
      at java.lang.String.startsWith(String.java:1450)
      at hudson.maven.MavenModuleSetBuild$1.isDescendantOf(MavenModuleSetBuild.java:178)
      at hudson.maven.MavenModuleSetBuild$1.<init>(MavenModuleSetBuild.java:147)
      at hudson.maven.MavenModuleSetBuild.getChangeSetFor(MavenModuleSetBuild.java:141)
      at hudson.maven.MavenModuleSetBuild$RunnerImpl.doRun(MavenModuleSetBuild.java:423)
      at hudson.model.AbstractBuild$AbstractRunner.run(AbstractBuild.java:416)
      at hudson.model.Run.run(Run.java:1280)
      at hudson.maven.MavenModuleSetBuild.run(MavenModuleSetBuild.java:293)
      at hudson.model.ResourceController.execute(ResourceController.java:88)
      at hudson.model.Executor.run(Executor.java:137)

          [JENKINS-7684] NullPointerException when an incremental build is triggered

          dogfood added a comment -

          Integrated in hudson_main_trunk #388
          JENKINS-7684 Attempting to fix - I think this works, but it needs more testing in other environments

          abayer :
          Files :

          • /trunk/hudson/main/maven-plugin/src/main/java/hudson/maven/MavenModuleSetBuild.java
          • /trunk/hudson/main/test/src/main/java/org/jvnet/hudson/test/ExtractResourceWithChangesSCM.java
          • /trunk/hudson/main/test/src/test/java/hudson/maven/MavenMultiModuleTest.java

          dogfood added a comment - Integrated in hudson_main_trunk #388 JENKINS-7684 Attempting to fix - I think this works, but it needs more testing in other environments abayer : Files : /trunk/hudson/main/maven-plugin/src/main/java/hudson/maven/MavenModuleSetBuild.java /trunk/hudson/main/test/src/main/java/org/jvnet/hudson/test/ExtractResourceWithChangesSCM.java /trunk/hudson/main/test/src/test/java/hudson/maven/MavenMultiModuleTest.java

          joachimsauer added a comment -

          The problem still seems to exist in the current 1.386 version.

          Builds that would result in a mail being sent (first broken build or first fixed build) reliably result in a NPE (and in a broken build in case it would have suceeded).

          For some reason the NPE no longer prints a stack trace here, I'll see if I can reproduce it.

          joachimsauer added a comment - The problem still seems to exist in the current 1.386 version. Builds that would result in a mail being sent (first broken build or first fixed build) reliably result in a NPE (and in a broken build in case it would have suceeded). For some reason the NPE no longer prints a stack trace here, I'll see if I can reproduce it.

          rainerweinhold added a comment - - edited

          Jup, still there.

          FileUtils.normalize will return null for paths starting with ".." (MavenModuleSetBuild.java:178)

          ERROR: Could not send email as a part of the post-build publishers.
          java.lang.NullPointerException
          at java.lang.String.startsWith(String.java:1433)
          at java.lang.String.startsWith(String.java:1462)
          at hudson.maven.MavenModuleSetBuild$1.isDescendantOf(MavenModuleSetBuild.java:178)
          at hudson.maven.MavenModuleSetBuild$1.<init>(MavenModuleSetBuild.java:147)

          Update:

          I did a short Testrun with a pached Plugin where i removed the FileUtils.normalize in :

          • MavenModuleSetBuild:168
            and - MavenModuleSetBuild:178

          This fixes the execption ... but i don't know the side effects.

          rainerweinhold added a comment - - edited Jup, still there. FileUtils.normalize will return null for paths starting with ".." (MavenModuleSetBuild.java:178) ERROR: Could not send email as a part of the post-build publishers. java.lang.NullPointerException at java.lang.String.startsWith(String.java:1433) at java.lang.String.startsWith(String.java:1462) at hudson.maven.MavenModuleSetBuild$1.isDescendantOf(MavenModuleSetBuild.java:178) at hudson.maven.MavenModuleSetBuild$1.<init>(MavenModuleSetBuild.java:147) Update: I did a short Testrun with a pached Plugin where i removed the FileUtils.normalize in : MavenModuleSetBuild:168 and - MavenModuleSetBuild:178 This fixes the execption ... but i don't know the side effects.

          Olivier Lamy added a comment -

          fixed with JENKINS-8525
          can you check with master ?

          Olivier Lamy added a comment - fixed with JENKINS-8525 can you check with master ?

          Marco Rothe added a comment -

          Still fails with

          java.lang.NullPointerException
          at java.lang.String.startsWith(String.java:1624)
          at java.lang.String.startsWith(String.java:1683)
          at hudson.maven.MavenModuleSetBuild$1.isDescendantOf(MavenModuleSetBuild.java:219)
          at hudson.maven.MavenModuleSetBuild$1.<init>(MavenModuleSetBuild.java:188)
          at hudson.maven.MavenModuleSetBuild.getChangeSetFor(MavenModuleSetBuild.java:182)

          There are still 2 FilenameUtils.normalize() calls in MavenModuleSetBuild which "normalize" relative paths like ../moduleOne to null.

          Marco Rothe added a comment - Still fails with java.lang.NullPointerException at java.lang.String.startsWith(String.java:1624) at java.lang.String.startsWith(String.java:1683) at hudson.maven.MavenModuleSetBuild$1.isDescendantOf(MavenModuleSetBuild.java:219) at hudson.maven.MavenModuleSetBuild$1.<init>(MavenModuleSetBuild.java:188) at hudson.maven.MavenModuleSetBuild.getChangeSetFor(MavenModuleSetBuild.java:182) There are still 2 FilenameUtils.normalize() calls in MavenModuleSetBuild which "normalize" relative paths like ../moduleOne to null.

          Marco Rothe added a comment - - edited

          Attached a patch to fix this (and related) issues the same way as JENKINS-8525.

          A path is not normalized if starts with "../". Maybe someone can apply the patch to the current master.

          Marco Rothe added a comment - - edited Attached a patch to fix this (and related) issues the same way as JENKINS-8525 . A path is not normalized if starts with "../". Maybe someone can apply the patch to the current master.

          Code changed in jenkins
          User: Olivier Lamy
          Path:
          maven-plugin/src/main/java/hudson/maven/MavenModuleSetBuild.java
          http://jenkins-ci.org/commit/core/a19afb186b2cef50862543618dd7fd12befafce6
          Log:
          [FIXED JENKINS-7684] NullPointerException when an incremental build is triggered

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Olivier Lamy Path: maven-plugin/src/main/java/hudson/maven/MavenModuleSetBuild.java http://jenkins-ci.org/commit/core/a19afb186b2cef50862543618dd7fd12befafce6 Log: [FIXED JENKINS-7684] NullPointerException when an incremental build is triggered

          Olivier Lamy added a comment -

          patch applied.
          Thanks !!

          Olivier Lamy added a comment - patch applied. Thanks !!

          dogfood added a comment -

          Integrated in jenkins_main_trunk #528
          [FIXED JENKINS-7684] NullPointerException when an incremental build is triggered

          Olivier Lamy :
          Files :

          • maven-plugin/src/main/java/hudson/maven/MavenModuleSetBuild.java

          dogfood added a comment - Integrated in jenkins_main_trunk #528 [FIXED JENKINS-7684] NullPointerException when an incremental build is triggered Olivier Lamy : Files : maven-plugin/src/main/java/hudson/maven/MavenModuleSetBuild.java

          Code changed in jenkins
          User: Olivier Lamy
          Path:
          src/main/java/hudson/maven/MavenModuleSetBuild.java
          http://jenkins-ci.org/commit/maven-plugin/3ec7c3f8903618757a84bba668e0f9d27eaa907e
          Log:
          [FIXED JENKINS-7684] NullPointerException when an incremental build is triggered

          Originally-Committed-As: a19afb186b2cef50862543618dd7fd12befafce6

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Olivier Lamy Path: src/main/java/hudson/maven/MavenModuleSetBuild.java http://jenkins-ci.org/commit/maven-plugin/3ec7c3f8903618757a84bba668e0f9d27eaa907e Log: [FIXED JENKINS-7684] NullPointerException when an incremental build is triggered Originally-Committed-As: a19afb186b2cef50862543618dd7fd12befafce6

            olamy Olivier Lamy
            gjernau gjernau
            Votes:
            10 Vote for this issue
            Watchers:
            13 Start watching this issue

              Created:
              Updated:
              Resolved: