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

java.lang.NullPointerException in the msbuild plugin when a job is executed by the parameterized build trigger plugin

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved (View Workflow)
    • Priority: Major
    • Resolution: Fixed
    • Component/s: msbuild-plugin
    • Labels:
      None
    • Environment:
      Windows 2008R2, .NET 4, Java 6, Jenkins ver 1.444 hosted by Tomcat7 running as a Windows Service.
    • Similar Issues:

      Description

      I have a job A which triggers job B from a build trigger build step. The job B contains a single msbuild step.
      The job B builds fine when started independently, but fails when started as a downstream job.
      Here is what it outputs:

      Path To MSBuild.exe: msbuild.exe
      FATAL: null
      java.lang.NullPointerException
      at hudson.plugins.msbuild.MsBuildBuilder.perform(MsBuildBuilder.java:94)
      at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:19)
      at hudson.model.AbstractBuild$AbstractRunner.perform(AbstractBuild.java:692)
      at hudson.model.Build$RunnerImpl.build(Build.java:178)
      at hudson.model.Build$RunnerImpl.doRun(Build.java:139)
      at hudson.model.AbstractBuild$AbstractRunner.run(AbstractBuild.java:462)
      at hudson.model.Run.run(Run.java:1404)
      at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:46)
      at hudson.model.ResourceController.execute(ResourceController.java:88)
      at hudson.model.Executor.run(Executor.java:238)

        Attachments

          Activity

          Hide
          markk Mark Kharitonov added a comment -

          Observing the plugin source code reveals the following code at MsBuildBuilder.java:94:

          if (ai.getDefaultArgs() != null)

          { args.addTokenized(ai.getDefaultArgs()); }

          Apparently, ai is null, which yields the NPE. I have recompiled the plugin adding the null reference check and things appear to be working OK. Of course, null ai may be a symptom of a much deeper problem, I do not know that.

          Show
          markk Mark Kharitonov added a comment - Observing the plugin source code reveals the following code at MsBuildBuilder.java:94: if (ai.getDefaultArgs() != null) { args.addTokenized(ai.getDefaultArgs()); } Apparently, ai is null, which yields the NPE. I have recompiled the plugin adding the null reference check and things appear to be working OK. Of course, null ai may be a symptom of a much deeper problem, I do not know that.
          Hide
          scm_issue_link SCM/JIRA link daemon added a comment -

          Code changed in jenkins
          User: Gregory Boissinot
          Path:
          src/main/java/hudson/plugins/msbuild/MsBuildBuilder.java
          http://jenkins-ci.org/commit/msbuild-plugin/a9d5634b60914a4292bcd001075adf6254b7a3a1
          Log:
          Fix JENKINS-12222

          Show
          scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Gregory Boissinot Path: src/main/java/hudson/plugins/msbuild/MsBuildBuilder.java http://jenkins-ci.org/commit/msbuild-plugin/a9d5634b60914a4292bcd001075adf6254b7a3a1 Log: Fix JENKINS-12222
          Hide
          gbois Gregory Boissinot added a comment -

          Please upgrade to 1.8.2.
          Thanks

          Show
          gbois Gregory Boissinot added a comment - Please upgrade to 1.8.2. Thanks

            People

            • Assignee:
              kdsweeney kdsweeney
              Reporter:
              markk Mark Kharitonov
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: