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

NPE thrown when a job uses an automatically installed JDK

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Major Major
    • versionnumber-plugin
    • None
    • versionnumber-plugin 1.5
      core 1.609.2

      When a job is using an automatically installed JDK and when the JDK is not available yet on build node, this NPE is thrown:

      ERROR: java.lang.NullPointerException
      java.lang.NullPointerException
      	at hudson.Launcher$ProcStarter.stdout(Launcher.java:262)
      	at hudson.tools.AbstractCommandInstaller.performInstallation(AbstractCommandInstaller.java:77)
      	at hudson.tools.InstallerTranslator.getToolHome(InstallerTranslator.java:68)
      	at hudson.tools.ToolLocationNodeProperty.getToolHome(ToolLocationNodeProperty.java:107)
      	at hudson.tools.ToolInstallation.translateFor(ToolInstallation.java:205)
      	at hudson.model.JDK.forNode(JDK.java:130)
      	at hudson.model.AbstractProject.getEnvironment(AbstractProject.java:355)
      	at hudson.model.Run.getEnvironment(Run.java:2228)
      	at hudson.model.AbstractBuild.getEnvironment(AbstractBuild.java:932)
      	at org.jvnet.hudson.tools.versionnumber.VersionNumberBuilder.getPreviousBuildWithVersionNumber(VersionNumberBuilder.java:204)
      	at org.jvnet.hudson.tools.versionnumber.VersionNumberBuilder.incBuild(VersionNumberBuilder.java:242)
      	at org.jvnet.hudson.tools.versionnumber.VersionNumberBuilder.setUp(VersionNumberBuilder.java:497)
      	at hudson.model.Build$BuildExecution.doRun(Build.java:154)
      	at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:536)
      	at hudson.model.Run.execute(Run.java:1738)
      	at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
      	at hudson.model.ResourceController.execute(ResourceController.java:98)
      	at hudson.model.Executor.run(Executor.java:381)
      

      Plugin is calling build.getEnvironment(null) here. Passing null doesn't seem to be legal.

            ydubreuil Yoann Dubreuil
            ydubreuil Yoann Dubreuil
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved: