NullPointerException in ToolEnvBuildWrapper

XMLWordPrintable

    • Type: Bug
    • Resolution: Unresolved
    • Priority: Major
    • Component/s: toolenv-plugin
    • None

      We have the following exception stack trace at the end of each build:

      10:31:35 ERROR: Could not install JDK_11_HOME
      10:31:35 java.lang.NullPointerException
      10:31:35 	at hudson.plugins.toolenv.ToolEnvBuildWrapper$1.buildEnvVars(ToolEnvBuildWrapper.java:47)
      10:31:35 	at hudson.model.AbstractBuild.getEnvironment(AbstractBuild.java:957)
      10:31:35 	at com.sonyericsson.hudson.plugins.gerrit.trigger.gerritnotifier.ParameterExpander.expandParameters(ParameterExpander.java:266)
      10:31:35 	at com.sonyericsson.hudson.plugins.gerrit.trigger.gerritnotifier.ParameterExpander.getBuildCompletedCommand(ParameterExpander.java:561)
      10:31:35 	at com.sonyericsson.hudson.plugins.gerrit.trigger.gerritnotifier.ParameterExpander.getBuildCompletedMessage(ParameterExpander.java:680)
      10:31:35 	at com.sonyericsson.hudson.plugins.gerrit.trigger.gerritnotifier.job.rest.BuildCompletedRestCommandJob.createReview(BuildCompletedRestCommandJob.java:81)
      10:31:35 	at com.sonymobile.tools.gerrit.gerritevents.workers.rest.AbstractRestCommandJob.run(AbstractRestCommandJob.java:94)
      10:31:35 	at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)
      10:31:35 	at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
      10:31:35 	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
      10:31:35 	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
      10:31:35 	at java.base/java.lang.Thread.run(Thread.java:829) 

      Please note that this does not fail the build. It only clutters the logs.

      I think Computer.currentComputer() returns null.
      With this PR, Computer.currentComputer() will be checked for nullity.

            Assignee:
            Unassigned
            Reporter:
            Réda Housni Alaoui
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: