java.lang.NullPointerException

Jenkins JIRA | Jeff Ekhardt | 12 months ago
  1. 0

    When a specific Java version is selected in a Maven Project and that Java version is configured to automatically install, there is a NullPointerException thrown related to using {{build.getEnvironment(listener)}} in email ext templates. This causes data loss in the reports related to environment variables. The exception from the jenkins log is: {code} Dec 15, 2015 1:34:59 PM org.apache.commons.jelly.expression.jexl.JexlExpression evaluate WARNING: Caught exception evaluating: build.getEnvironment(listener). Reason: java.lang.NullPointerException java.lang.NullPointerException at hudson.tools.JDKInstaller.performInstallation(JDKInstaller.java:119) 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 hudson.maven.AbstractMavenBuild.getEnvironment(AbstractMavenBuild.java:56) at hudson.maven.MavenModuleSetBuild.getEnvironment(MavenModuleSetBuild.java:166) at sun.reflect.GeneratedMethodAccessor1371.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:606) at org.apache.commons.jexl.util.introspection.UberspectImpl$VelMethodImpl.invoke(UberspectImpl.java:258) at org.apache.commons.jexl.parser.ASTMethod.execute(ASTMethod.java:104) at org.apache.commons.jexl.parser.ASTReference.execute(ASTReference.java:83) at org.apache.commons.jexl.parser.ASTReference.value(ASTReference.java:57) at org.apache.commons.jexl.parser.ASTReferenceExpression.value(ASTReferenceExpression.java:51) at org.apache.commons.jexl.ExpressionImpl.evaluate(ExpressionImpl.java:80) at org.apache.commons.jelly.expression.jexl.JexlExpression.evaluate(JexlExpression.java:69) at org.apache.commons.jelly.tags.core.CoreTagLibrary$3.run(CoreTagLibrary.java:134) at org.apache.commons.jelly.impl.ScriptBlock.run(ScriptBlock.java:95) at org.apache.commons.jelly.TagSupport.invokeBody(TagSupport.java:161) at org.apache.commons.jelly.impl.StaticTag.doTag(StaticTag.java:65) at org.apache.commons.jelly.impl.StaticTagScript.run(StaticTagScript.java:124) at org.apache.commons.jelly.tags.core.CoreTagLibrary$2.run(CoreTagLibrary.java:105) at hudson.plugins.emailext.plugins.content.JellyScriptContent.convert(JellyScriptContent.java:82) at hudson.plugins.emailext.plugins.content.JellyScriptContent.renderContent(JellyScriptContent.java:73) at hudson.plugins.emailext.plugins.content.JellyScriptContent.evaluate(JellyScriptContent.java:48) at org.jenkinsci.plugins.tokenmacro.DataBoundTokenMacro.evaluate(DataBoundTokenMacro.java:190) at org.jenkinsci.plugins.tokenmacro.TokenMacro.expand(TokenMacro.java:191) at org.jenkinsci.plugins.tokenmacro.TokenMacro.expandAll(TokenMacro.java:246) at hudson.plugins.emailext.plugins.ContentBuilder.transformText(ContentBuilder.java:71) at hudson.plugins.emailext.ExtendedEmailPublisher.addContent(ExtendedEmailPublisher.java:671) at hudson.plugins.emailext.ExtendedEmailPublisher.createMail(ExtendedEmailPublisher.java:550) at hudson.plugins.emailext.ExtendedEmailPublisher.sendMail(ExtendedEmailPublisher.java:331) at hudson.plugins.emailext.ExtendedEmailPublisher._perform(ExtendedEmailPublisher.java:322) at hudson.plugins.emailext.ExtendedEmailPublisher.perform(ExtendedEmailPublisher.java:230) at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:20) at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:776) at hudson.model.AbstractBuild$AbstractBuildExecution.performAllBuildSteps(AbstractBuild.java:723) at hudson.maven.MavenModuleSetBuild$MavenModuleSetBuildExecution.cleanUp(MavenModuleSetBuild.java:1071) at hudson.model.Run.execute(Run.java:1785) at hudson.maven.MavenModuleSetBuild.run(MavenModuleSetBuild.java:531) at hudson.model.ResourceController.execute(ResourceController.java:98) at hudson.model.Executor.run(Executor.java:381) {code} The code in the jelly template is: {code} <j:set var="envVars" value="${build.getEnvironment(listener)}" /> {code}

    Jenkins JIRA | 12 months ago | Jeff Ekhardt
    java.lang.NullPointerException
  2. 0

    When a specific Java version is selected in a Maven Project and that Java version is configured to automatically install, there is a NullPointerException thrown related to using {{build.getEnvironment(listener)}} in email ext templates. This causes data loss in the reports related to environment variables. The exception from the jenkins log is: {code} Dec 15, 2015 1:34:59 PM org.apache.commons.jelly.expression.jexl.JexlExpression evaluate WARNING: Caught exception evaluating: build.getEnvironment(listener). Reason: java.lang.NullPointerException java.lang.NullPointerException at hudson.tools.JDKInstaller.performInstallation(JDKInstaller.java:119) 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 hudson.maven.AbstractMavenBuild.getEnvironment(AbstractMavenBuild.java:56) at hudson.maven.MavenModuleSetBuild.getEnvironment(MavenModuleSetBuild.java:166) at sun.reflect.GeneratedMethodAccessor1371.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:606) at org.apache.commons.jexl.util.introspection.UberspectImpl$VelMethodImpl.invoke(UberspectImpl.java:258) at org.apache.commons.jexl.parser.ASTMethod.execute(ASTMethod.java:104) at org.apache.commons.jexl.parser.ASTReference.execute(ASTReference.java:83) at org.apache.commons.jexl.parser.ASTReference.value(ASTReference.java:57) at org.apache.commons.jexl.parser.ASTReferenceExpression.value(ASTReferenceExpression.java:51) at org.apache.commons.jexl.ExpressionImpl.evaluate(ExpressionImpl.java:80) at org.apache.commons.jelly.expression.jexl.JexlExpression.evaluate(JexlExpression.java:69) at org.apache.commons.jelly.tags.core.CoreTagLibrary$3.run(CoreTagLibrary.java:134) at org.apache.commons.jelly.impl.ScriptBlock.run(ScriptBlock.java:95) at org.apache.commons.jelly.TagSupport.invokeBody(TagSupport.java:161) at org.apache.commons.jelly.impl.StaticTag.doTag(StaticTag.java:65) at org.apache.commons.jelly.impl.StaticTagScript.run(StaticTagScript.java:124) at org.apache.commons.jelly.tags.core.CoreTagLibrary$2.run(CoreTagLibrary.java:105) at hudson.plugins.emailext.plugins.content.JellyScriptContent.convert(JellyScriptContent.java:82) at hudson.plugins.emailext.plugins.content.JellyScriptContent.renderContent(JellyScriptContent.java:73) at hudson.plugins.emailext.plugins.content.JellyScriptContent.evaluate(JellyScriptContent.java:48) at org.jenkinsci.plugins.tokenmacro.DataBoundTokenMacro.evaluate(DataBoundTokenMacro.java:190) at org.jenkinsci.plugins.tokenmacro.TokenMacro.expand(TokenMacro.java:191) at org.jenkinsci.plugins.tokenmacro.TokenMacro.expandAll(TokenMacro.java:246) at hudson.plugins.emailext.plugins.ContentBuilder.transformText(ContentBuilder.java:71) at hudson.plugins.emailext.ExtendedEmailPublisher.addContent(ExtendedEmailPublisher.java:671) at hudson.plugins.emailext.ExtendedEmailPublisher.createMail(ExtendedEmailPublisher.java:550) at hudson.plugins.emailext.ExtendedEmailPublisher.sendMail(ExtendedEmailPublisher.java:331) at hudson.plugins.emailext.ExtendedEmailPublisher._perform(ExtendedEmailPublisher.java:322) at hudson.plugins.emailext.ExtendedEmailPublisher.perform(ExtendedEmailPublisher.java:230) at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:20) at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:776) at hudson.model.AbstractBuild$AbstractBuildExecution.performAllBuildSteps(AbstractBuild.java:723) at hudson.maven.MavenModuleSetBuild$MavenModuleSetBuildExecution.cleanUp(MavenModuleSetBuild.java:1071) at hudson.model.Run.execute(Run.java:1785) at hudson.maven.MavenModuleSetBuild.run(MavenModuleSetBuild.java:531) at hudson.model.ResourceController.execute(ResourceController.java:98) at hudson.model.Executor.run(Executor.java:381) {code} The code in the jelly template is: {code} <j:set var="envVars" value="${build.getEnvironment(listener)}" /> {code}

    Jenkins JIRA | 12 months ago | Jeff Ekhardt
    java.lang.NullPointerException
  3. Speed up your debug routine!

    Automated exception search integrated into your IDE

  4. 0

    happened after upgrade to 2.2.0 Oct 9, 2010 11:32:30 AM com.sonyericsson.hudson.plugins.gerrit.trigger.gerritnotifier.ParameterExpander expandParameters SEVERE: Failed to expand env vars into gerrit cmd. Gerrit won't be notified!! java.lang.NullPointerException at hudson.model.Run.getEnvironment(Run.java:1680) at hudson.model.AbstractBuild.getEnvironment(AbstractBuild.java:682) at com.sonyericsson.hudson.plugins.gerrit.trigger.gerritnotifier.ParameterExpander.expandParameters(ParameterExpander.java:210) at com.sonyericsson.hudson.plugins.gerrit.trigger.gerritnotifier.ParameterExpander.getBuildStartedCommand(ParameterExpander.java:96) at com.sonyericsson.hudson.plugins.gerrit.trigger.gerritnotifier.GerritNotifier.buildStarted(GerritNotifier.java:79) at com.sonyericsson.hudson.plugins.gerrit.trigger.gerritnotifier.job.BuildStartedCommandJob.run(BuildStartedCommandJob.java:72) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471) at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334) at java.util.concurrent.FutureTask.run(FutureTask.java:166) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603) at java.lang.Thread.run(Thread.java:636) Oct 9, 2010 11:32:30 AM com.sonyericsson.hudson.plugins.gerrit.trigger.gerritnotifier.GerritNotifier buildStarted SEVERE: Something wrong during parameter extraction. Gerrit will not be notified of BuildStarted

    Jenkins JIRA | 6 years ago | Kevin Cai
    java.lang.NullPointerException
  5. 0

    After upgrading to Hudson 1.379 and ClearCase 1.3.1, our polling is no longer working. We have an environment variable in our view names (to shorten our often-verbose computernames). For some of the polling commands, the resolution is working fine. You can see that in the command output the SHORT_COMPUTERNAME variable has been resolved properly form the lsview command. Started on Oct 26, 2010 10:05:51 AM [dev] $ cleartool desc -fmt %[found_bls]Xp\n stream:Core_6.5_Int@\WFX_PVOB baseline:Core_64_ML_1_13_2010__seed_6.5@\WFX_PVOB [dev] $ cleartool desc -fmt %[component]Xp\n baseline:Core_64_ML_1_13_2010__seed_6.5@\WFX_PVOB component:core@\WFX_PVOB [dev] $ cleartool lsview ${SHORT_COMPUTERNAME}_core_6.5 H-076908_core_6.5 \\SUMSHAH-076908\ccstg_c\H-076908_core_6.5.vws [${SHORT_COMPUTERNAME}_core_6.5] $ cleartool lshistory -all -since 26-oct-10.12:05:51utc+0000 -fmt '\"%Nd\" \"%u\" \"%En\" \"%Vn\" \"%e\" \"%o\" \"%[activity]p\" \n%c\n' -branch brtype:Core_6.5_Int -nco WFX_Core\core [dev] $ cleartool desc -fmt %[found_bls]Xp\n stream:Core_6.5_Int@\WFX_PVOB baseline:Core_64_ML_1_13_2010__seed_6.5@\WFX_PVOB [dev] $ cleartool desc -fmt %[component]Xp\n baseline:Core_64_ML_1_13_2010__seed_6.5@\WFX_PVOB component:core@\WFX_PVOB Done. Took 1 sec No changes But we're seeing this in our hudson.err.log at each polling interval: Oct 25, 2010 1:00:51 PM hudson.plugins.clearcase.util.BuildVariableResolver resolve WARNING: Variable name 'SHORT_COMPUTERNAME' look up failed java.lang.NullPointerException at hudson.model.Run.getEnvironment(Run.java:1680) at hudson.model.AbstractBuild.getEnvironment(AbstractBuild.java:682) at hudson.plugins.clearcase.util.BuildVariableResolver.resolve(BuildVariableResolver.java:116) at hudson.plugins.clearcase.util.BuildVariableResolver.resolve(BuildVariableResolver.java:58) at hudson.Util.replaceMacro(Util.java:174) at hudson.plugins.clearcase.AbstractClearCaseScm.getViewName(AbstractClearCaseScm.java:307) at hudson.plugins.clearcase.AbstractClearCaseScm.compareRemoteRevisionWith(AbstractClearCaseScm.java:537) at hudson.scm.SCM._compareRemoteRevisionWith(SCM.java:353) at hudson.scm.SCM.poll(SCM.java:370) at hudson.model.AbstractProject.poll(AbstractProject.java:1195) at hudson.triggers.SCMTrigger$Runner.runPolling(SCMTrigger.java:417) at hudson.triggers.SCMTrigger$Runner.run(SCMTrigger.java:446) at hudson.util.SequentialExecutionQueue$QueueEntry.run(SequentialExecutionQueue.java:118) at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source) at java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source) at java.util.concurrent.FutureTask.run(Unknown Source) at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source) at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) at java.lang.Thread.run(Unknown Source)

    Jenkins JIRA | 6 years ago | dhauslad
    java.lang.NullPointerException

    Not finding the right solution?
    Take a tour to get the most out of Samebug.

    Tired of useless tips?

    Automated exception search integrated into your IDE

    Root Cause Analysis

    1. java.lang.NullPointerException

      No message provided

      at hudson.tools.JDKInstaller.performInstallation()
    2. Hudson
      AbstractBuild.getEnvironment
      1. hudson.tools.JDKInstaller.performInstallation(JDKInstaller.java:119)
      2. hudson.tools.InstallerTranslator.getToolHome(InstallerTranslator.java:68)
      3. hudson.tools.ToolLocationNodeProperty.getToolHome(ToolLocationNodeProperty.java:107)
      4. hudson.tools.ToolInstallation.translateFor(ToolInstallation.java:205)
      5. hudson.model.JDK.forNode(JDK.java:130)
      6. hudson.model.AbstractProject.getEnvironment(AbstractProject.java:355)
      7. hudson.model.Run.getEnvironment(Run.java:2228)
      8. hudson.model.AbstractBuild.getEnvironment(AbstractBuild.java:932)
      8 frames
    3. Hudson Maven Embedder
      MavenModuleSetBuild.getEnvironment
      1. hudson.maven.AbstractMavenBuild.getEnvironment(AbstractMavenBuild.java:56)
      2. hudson.maven.MavenModuleSetBuild.getEnvironment(MavenModuleSetBuild.java:166)
      2 frames
    4. Java RT
      Method.invoke
      1. sun.reflect.GeneratedMethodAccessor1371.invoke(Unknown Source)
      2. sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      3. java.lang.reflect.Method.invoke(Method.java:606)
      3 frames
    5. Commons JEXL
      ExpressionImpl.evaluate
      1. org.apache.commons.jexl.util.introspection.UberspectImpl$VelMethodImpl.invoke(UberspectImpl.java:258)
      2. org.apache.commons.jexl.parser.ASTMethod.execute(ASTMethod.java:104)
      3. org.apache.commons.jexl.parser.ASTReference.execute(ASTReference.java:83)
      4. org.apache.commons.jexl.parser.ASTReference.value(ASTReference.java:57)
      5. org.apache.commons.jexl.parser.ASTReferenceExpression.value(ASTReferenceExpression.java:51)
      6. org.apache.commons.jexl.ExpressionImpl.evaluate(ExpressionImpl.java:80)
      6 frames
    6. commons-jelly
      CoreTagLibrary$2.run
      1. org.apache.commons.jelly.expression.jexl.JexlExpression.evaluate(JexlExpression.java:69)
      2. org.apache.commons.jelly.tags.core.CoreTagLibrary$3.run(CoreTagLibrary.java:134)
      3. org.apache.commons.jelly.impl.ScriptBlock.run(ScriptBlock.java:95)
      4. org.apache.commons.jelly.TagSupport.invokeBody(TagSupport.java:161)
      5. org.apache.commons.jelly.impl.StaticTag.doTag(StaticTag.java:65)
      6. org.apache.commons.jelly.impl.StaticTagScript.run(StaticTagScript.java:124)
      7. org.apache.commons.jelly.tags.core.CoreTagLibrary$2.run(CoreTagLibrary.java:105)
      7 frames
    7. Hudson Email Extension Plugin
      JellyScriptContent.evaluate
      1. hudson.plugins.emailext.plugins.content.JellyScriptContent.convert(JellyScriptContent.java:82)
      2. hudson.plugins.emailext.plugins.content.JellyScriptContent.renderContent(JellyScriptContent.java:73)
      3. hudson.plugins.emailext.plugins.content.JellyScriptContent.evaluate(JellyScriptContent.java:48)
      3 frames
    8. Token Macro Plugin
      TokenMacro.expandAll
      1. org.jenkinsci.plugins.tokenmacro.DataBoundTokenMacro.evaluate(DataBoundTokenMacro.java:190)
      2. org.jenkinsci.plugins.tokenmacro.TokenMacro.expand(TokenMacro.java:191)
      3. org.jenkinsci.plugins.tokenmacro.TokenMacro.expandAll(TokenMacro.java:246)
      3 frames
    9. Hudson Email Extension Plugin
      ExtendedEmailPublisher.perform
      1. hudson.plugins.emailext.plugins.ContentBuilder.transformText(ContentBuilder.java:71)
      2. hudson.plugins.emailext.ExtendedEmailPublisher.addContent(ExtendedEmailPublisher.java:671)
      3. hudson.plugins.emailext.ExtendedEmailPublisher.createMail(ExtendedEmailPublisher.java:550)
      4. hudson.plugins.emailext.ExtendedEmailPublisher.sendMail(ExtendedEmailPublisher.java:331)
      5. hudson.plugins.emailext.ExtendedEmailPublisher._perform(ExtendedEmailPublisher.java:322)
      6. hudson.plugins.emailext.ExtendedEmailPublisher.perform(ExtendedEmailPublisher.java:230)
      6 frames
    10. Hudson
      AbstractBuild$AbstractBuildExecution.performAllBuildSteps
      1. hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:20)
      2. hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:776)
      3. hudson.model.AbstractBuild$AbstractBuildExecution.performAllBuildSteps(AbstractBuild.java:723)
      3 frames
    11. Hudson Maven Embedder
      MavenModuleSetBuild$MavenModuleSetBuildExecution.cleanUp
      1. hudson.maven.MavenModuleSetBuild$MavenModuleSetBuildExecution.cleanUp(MavenModuleSetBuild.java:1071)
      1 frame
    12. Hudson
      Run.execute
      1. hudson.model.Run.execute(Run.java:1785)
      1 frame
    13. Hudson Maven Embedder
      MavenModuleSetBuild.run
      1. hudson.maven.MavenModuleSetBuild.run(MavenModuleSetBuild.java:531)
      1 frame
    14. Hudson
      Executor.run
      1. hudson.model.ResourceController.execute(ResourceController.java:98)
      2. hudson.model.Executor.run(Executor.java:381)
      2 frames