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

NullPointerException after a successful maven build

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: Major
    • Resolution: Incomplete
    • Component/s: starteam-plugin
    • Labels:
      None
    • Environment:
      Platform: All, OS: All
    • Similar Issues:

      Description

      Here is an error that I have randomly, after a maven build. The maven build
      seems to have been successful, but it seems that a post process creates a
      problem.

      [INFO] ------------------------------------------------------------------------
      [INFO] BUILD SUCCESSFUL
      [INFO] ------------------------------------------------------------------------
      [INFO] Total time: 32 seconds
      [INFO] Finished at: Wed Oct 21 18:32:31 EDT 2009
      [INFO] Final Memory: 38M/63M
      [INFO] ------------------------------------------------------------------------
      ERROR: Processing failed due to a bug in the code. Please report this to
      users@hudson.dev.java.net
      java.lang.NullPointerException
      at
      hudson.maven.MavenModuleSetBuild$1.isDescendantOf(MavenModuleSetBuild.java:200)
      at
      hudson.maven.MavenModuleSetBuild$1.<init>(MavenModuleSetBuild.java:170)
      at
      hudson.maven.MavenModuleSetBuild.getChangeSetFor(MavenModuleSetBuild.java:164)
      at
      hudson.maven.FilteredChangeLogSet.<init>(FilteredChangeLogSet.java:52)
      at hudson.maven.MavenBuild.getChangeSet(MavenBuild.java:159)
      at hudson.model.AbstractBuild.getCulprits(AbstractBuild.java:270)
      at hudson.tasks.MailSender.createEmptyMail(MailSender.java:320)
      at hudson.tasks.MailSender.createBackToNormalMail(MailSender.java:156)
      at hudson.tasks.MailSender.getMail(MailSender.java:147)
      at hudson.tasks.MailSender.execute(MailSender.java:81)
      at hudson.maven.reporters.MavenMailer.end(MavenMailer.java:54)
      at
      hudson.maven.MavenModuleSetBuild$Builder.end(MavenModuleSetBuild.java:679)
      at
      hudson.maven.MavenModuleSetBuild$RunnerImpl.doRun(MavenModuleSetBuild.java:482)
      at hudson.model.AbstractBuild$AbstractRunner.run(AbstractBuild.java:375)
      at hudson.model.Run.run(Run.java:1120)
      at hudson.maven.MavenModuleSetBuild.run(MavenModuleSetBuild.java:303)
      at hudson.model.ResourceController.execute(ResourceController.java:88)
      at hudson.model.Executor.run(Executor.java:123)
      project=hudson.maven.MavenModuleSet@9a99eb[swix]
      project.getModules()=[hudson.maven.MavenModule@1b2b450[swix/com.zerobase.swix:sw
      ix-aggregator], hudson.maven.MavenModule@15c13ef[swix/com.zerobase.swix:swix-
      client], hudson.maven.MavenModule@1dd9169[swix/com.zerobase.swix:swix-parent],
      hudson.maven.MavenModule@20dcb7[swix/com.zerobase.swix:swix-scenarioconfig],
      hudson.maven.MavenModule@17aa2a8[swix/com.zerobase.swix:swix-ujac_ui]]
      project.getRootModule()=hudson.maven.MavenModule@1b2b450[swix/com.zerobase.swix:
      swix-aggregator]
      FATAL: null
      java.lang.NullPointerException
      at
      hudson.maven.MavenModuleSetBuild$1.isDescendantOf(MavenModuleSetBuild.java:200)
      at
      hudson.maven.MavenModuleSetBuild$1.<init>(MavenModuleSetBuild.java:170)
      at
      hudson.maven.MavenModuleSetBuild.getChangeSetFor(MavenModuleSetBuild.java:164)
      at
      hudson.maven.FilteredChangeLogSet.<init>(FilteredChangeLogSet.java:52)
      at hudson.maven.MavenBuild.getChangeSet(MavenBuild.java:159)
      at hudson.model.AbstractBuild.getCulprits(AbstractBuild.java:270)
      at hudson.tasks.MailSender.createEmptyMail(MailSender.java:320)
      at hudson.tasks.MailSender.createBackToNormalMail(MailSender.java:156)
      at hudson.tasks.MailSender.getMail(MailSender.java:147)
      at hudson.tasks.MailSender.execute(MailSender.java:81)
      at hudson.maven.reporters.MavenMailer.end(MavenMailer.java:54)
      at
      hudson.maven.MavenModuleSetBuild$Builder.end(MavenModuleSetBuild.java:679)
      at
      hudson.maven.MavenModuleSetBuild$RunnerImpl.doRun(MavenModuleSetBuild.java:482)
      at hudson.model.AbstractBuild$AbstractRunner.run(AbstractBuild.java:375)
      at hudson.model.Run.run(Run.java:1120)
      at hudson.maven.MavenModuleSetBuild.run(MavenModuleSetBuild.java:303)
      at hudson.model.ResourceController.execute(ResourceController.java:88)
      at hudson.model.Executor.run(Executor.java:123)

        Attachments

          Activity

          Hide
          abayer Andrew Bayer added a comment -

          What SCM are you using, and what version of Hudson? For builds with this NPE,
          are there changes listed? I think this may be connected to the problems that are
          floating around with properly recording changesets for CVS builds, but I could
          be wrong.

          Show
          abayer Andrew Bayer added a comment - What SCM are you using, and what version of Hudson? For builds with this NPE, are there changes listed? I think this may be connected to the problems that are floating around with properly recording changesets for CVS builds, but I could be wrong.
          Hide
          creto creto added a comment -

          Sorry about the missing information.

          Using Hudson 1.329, on Tomcat 6.0.20, with StarTeam. I've done some works around
          the StarTeam plugin, and it was working pretty much really good for a long time
          now...

          I've seen the "isDescendantOf" causing a NullPointerException also while building
          a C++ project with "I don't remember" maven plugin...

          Show
          creto creto added a comment - Sorry about the missing information. Using Hudson 1.329, on Tomcat 6.0.20, with StarTeam. I've done some works around the StarTeam plugin, and it was working pretty much really good for a long time now... I've seen the "isDescendantOf" causing a NullPointerException also while building a C++ project with "I don't remember" maven plugin...
          Hide
          abayer Andrew Bayer added a comment -

          Ah-ha. I just checked, and it looks like the StarTeam plugin doesn't actually
          support changesets - it always returns an empty changeset. That's causing the
          Maven plugin's logic for emailing "culprits" when there are errors or test
          failures to break, since there's no way to tell who committed what. I'm
          recategorizing this as a StarTeam plugin bug.

          Show
          abayer Andrew Bayer added a comment - Ah-ha. I just checked, and it looks like the StarTeam plugin doesn't actually support changesets - it always returns an empty changeset. That's causing the Maven plugin's logic for emailing "culprits" when there are errors or test failures to break, since there's no way to tell who committed what. I'm recategorizing this as a StarTeam plugin bug.
          Hide
          creto creto added a comment -

          Well, as I said, I did some modification to the StarTeam plugin, and my version
          does handle the change set. I made those modifications to be able to view the
          "Changes" section in my build page.

          Show
          creto creto added a comment - Well, as I said, I did some modification to the StarTeam plugin, and my version does handle the change set. I made those modifications to be able to view the "Changes" section in my build page.
          Hide
          abayer Andrew Bayer added a comment -

          Well, at a guess, I'd still assume the problem is in the StarTeam plugin, since
          this behavior works fine for all the SCMs I've used it on. Since you've made
          local changes to the StarTeam plugin, I can't really help with debugging those.

          Show
          abayer Andrew Bayer added a comment - Well, at a guess, I'd still assume the problem is in the StarTeam plugin, since this behavior works fine for all the SCMs I've used it on. Since you've made local changes to the StarTeam plugin, I can't really help with debugging those.
          Hide
          creto creto added a comment -

          I think I got it. Looking into the code, I found that in
          MavenModuleSetBuild.java, starting at line 199:

          private boolean isDescendantOf(ChangeLogSet.Entry e, MavenModule mod) {
          for (String path : e.getAffectedPaths())
          if(path.startsWith(mod.getRelativePath()))
          return true;
          return false;
          }

          And my implementation of hudson.scm.ChangeLogSet.Entry (which I named
          StarTeamChangeLogEntry) is having this method:

          public Collection<String> getAffectedPaths() {
          // TODO Auto-generated method stub
          return null;
          }

          That explains the NullPointerException.

          Could you take a look into the original StarTeamChangeLogEntry? Or could you
          point me where I could find the source code of the plugin?

          Show
          creto creto added a comment - I think I got it. Looking into the code, I found that in MavenModuleSetBuild.java, starting at line 199: private boolean isDescendantOf(ChangeLogSet.Entry e, MavenModule mod) { for (String path : e.getAffectedPaths()) if(path.startsWith(mod.getRelativePath())) return true; return false; } And my implementation of hudson.scm.ChangeLogSet.Entry (which I named StarTeamChangeLogEntry) is having this method: public Collection<String> getAffectedPaths() { // TODO Auto-generated method stub return null; } That explains the NullPointerException. Could you take a look into the original StarTeamChangeLogEntry? Or could you point me where I could find the source code of the plugin?
          Hide
          creto creto added a comment -

          Well, I do confirm that this bug is due to my code, which is based on Eric
          Broyles's code.

          I changed the code from

          public Collection<String> getAffectedPaths() {
          return null;
          }

          to

          public Collection<String> getAffectedPaths() {
          /*

          • Now using {@link Collections.emptyList}

            , since returning null was
            causing NullPointerException in

          • MavenModuleSetBuild$1.isDescendantOf() on the following line:
          • for (String path : e.getAffectedPaths()) { if(path.startsWith(mod.getRelativePath())) }

            */
            return Collections.emptyList();
            }

          Sorry for bothering you guys!!!

          Show
          creto creto added a comment - Well, I do confirm that this bug is due to my code, which is based on Eric Broyles's code. I changed the code from public Collection<String> getAffectedPaths() { return null; } to public Collection<String> getAffectedPaths() { /* Now using {@link Collections.emptyList} , since returning null was causing NullPointerException in MavenModuleSetBuild$1.isDescendantOf() on the following line: for (String path : e.getAffectedPaths()) { if(path.startsWith(mod.getRelativePath())) } */ return Collections.emptyList(); } Sorry for bothering you guys!!!
          Hide
          jan_ruzicka jan_ruzicka added a comment -

          This was a bug in localy modified code.

          Show
          jan_ruzicka jan_ruzicka added a comment - This was a bug in localy modified code.

            People

            • Assignee:
              Unassigned
              Reporter:
              creto creto
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: