java.lang.NullPointerException

Jenkins JIRA | dmeibusch | 6 years ago
  1. 0

    The Build-Pipeline view is empty after upgrading to CopyArtifact 1.15 (from 1.14) and upgrading Build-Pipeline from 1.0 to 1.1.1. Stack trace has a NPE from hudson.plugins.copyartifact.CopyArtifact. WARNING: Caught exception evaluating: from.getBuildPipelineForm(). Reason: java.lang.NullPointerException java.lang.NullPointerException at java.util.TreeMap.putAll(TreeMap.java:290) at hudson.plugins.copyartifact.CopyArtifact$EnvAction.buildEnvVars(CopyArtifact.java:359) at hudson.model.AbstractBuild.getEnvironment(AbstractBuild.java:756) at au.com.centrumsystems.hudson.plugin.buildpipeline.PipelineBuild.getBuildResultURL(PipelineBuild.java:190) at au.com.centrumsystems.hudson.plugin.buildpipeline.BuildForm.<init>(BuildForm.java:66) at au.com.centrumsystems.hudson.plugin.buildpipeline.BuildForm.<init>(BuildForm.java:82) at au.com.centrumsystems.hudson.plugin.buildpipeline.BuildPipelineView.getBuildPipelineForm(BuildPipelineView.java:214) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) 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 hudson.ExpressionFactory2$JexlExpression.evaluate(ExpressionFactory2.java:72) at org.apache.commons.jelly.tags.core.CoreTagLibrary$3.run(CoreTagLibrary.java:134 ... Raised also as an issue on Build-Pipeline: http://code.google.com/p/build-pipeline-plugin/issues/list?thanks=19&ts=1302748637

    Jenkins JIRA | 6 years ago | dmeibusch
    java.lang.NullPointerException
  2. 0

    A classic case where two plugins work together to cause an error. On the left hand we have the PipelineBuild plugin. This plugin calls {{currentBuild.getEnvironment(null)}} to obtain certain data. This on itself does not actually break something, but I can't imagine calling that method with {{null}} is right. On the right hand we have the CopyArtifact plugin. This plugin introduces a new {{EnvironmentContributingAction}} ("EnvAction") which does not expect a null pointer to be passed. The method mentioned above walks through a list of {{EnvironmentContributingAction}} objects, and calls their {{buildEnvVars}} method. However, because the {{currentBuild.getEnvironment method}} is called with {{null}}, it cannot resolve an {{EnvVars}} object and falls back to {{null}}. That nullpointer is supplied to the CopyArtifact "EnvAction" action which tries to do things with the nullpointer. Obviously that action is causing an error. h5. Links: - [Build Pipeline code|http://code.google.com/p/build-pipeline-plugin/source/browse/src/main/java/au/com/centrumsystems/hudson/plugin/buildpipeline/PipelineBuild.java#414] - [Copy Artifact code|https://github.com/jenkinsci/copyartifact-plugin/blob/master/src/main/java/hudson/plugins/copyartifact/CopyArtifact.java#L359] - [Jenkins combining factor|https://github.com/jenkinsci/jenkins/blob/master/core/src/main/java/hudson/model/AbstractBuild.java#L756] Stacktrace: {noformat} WARNING: Caught exception evaluating: from.getBuildPipelineForm(). Reason: java.lang.NullPointerException java.lang.NullPointerException at java.util.TreeMap.putAll(TreeMap.java:290) at hudson.plugins.copyartifact.CopyArtifact$EnvAction.buildEnvVars(CopyArtifact.java:359) at hudson.model.AbstractBuild.getEnvironment(AbstractBuild.java:756) at au.com.centrumsystems.hudson.plugin.buildpipeline.PipelineBuild.getBuildResultURL(PipelineBuild.java:190) at au.com.centrumsystems.hudson.plugin.buildpipeline.BuildForm.<init>(BuildForm.java:66) at au.com.centrumsystems.hudson.plugin.buildpipeline.BuildForm.<init>(BuildForm.java:82) at au.com.centrumsystems.hudson.plugin.buildpipeline.BuildPipelineView.getBuildPipelineForm(BuildPipelineView.java:214) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) 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 hudson.ExpressionFactory2$JexlExpression.evaluate(ExpressionFactory2.java:72) 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.kohsuke.stapler.jelly.ReallyStaticTagLibrary$1.run(ReallyStaticTagLibrary.java:99) at org.apache.commons.jelly.impl.ScriptBlock.run(ScriptBlock.java:95) at org.kohsuke.stapler.jelly.ReallyStaticTagLibrary$1.run(ReallyStaticTagLibrary.java:99) at org.apache.commons.jelly.impl.ScriptBlock.run(ScriptBlock.java:95) at org.apache.commons.jelly.tags.core.CoreTagLibrary$2.run(CoreTagLibrary.java:105) at org.kohsuke.stapler.jelly.JellyViewScript.run(JellyViewScript.java:63) at org.kohsuke.stapler.jelly.IncludeTag.doTag(IncludeTag.java:146) at org.apache.commons.jelly.impl.TagScript.run(TagScript.java:270) at org.apache.commons.jelly.impl.ScriptBlock.run(ScriptBlock.java:95) at org.kohsuke.stapler.jelly.CallTagLibScript$1.run(CallTagLibScript.java:98) at org.apache.commons.jelly.tags.define.InvokeBodyTag.doTag(InvokeBodyTag.java:91) at org.apache.commons.jelly.impl.TagScript.run(TagScript.java:270) at org.apache.commons.jelly.impl.ScriptBlock.run(ScriptBlock.java:95) at org.apache.commons.jelly.tags.core.CoreTagLibrary$1.run(CoreTagLibrary.java:98) at org.apache.commons.jelly.impl.ScriptBlock.run(ScriptBlock.java:95) at org.apache.commons.jelly.tags.core.CoreTagLibrary$2.run(CoreTagLibrary.java:105) at org.kohsuke.stapler.jelly.CallTagLibScript.run(CallTagLibScript.java:119) at org.apache.commons.jelly.impl.ScriptBlock.run(ScriptBlock.java:95) at org.kohsuke.stapler.jelly.CallTagLibScript$1.run(CallTagLibScript.java:98) at org.apache.commons.jelly.tags.define.InvokeBodyTag.doTag(InvokeBodyTag.java:91) at org.apache.commons.jelly.impl.TagScript.run(TagScript.java:270) at org.apache.commons.jelly.impl.ScriptBlock.run(ScriptBlock.java:95) at org.kohsuke.stapler.jelly.ReallyStaticTagLibrary$1.run(ReallyStaticTagLibrary.java:99) at org.apache.commons.jelly.impl.ScriptBlock.run(ScriptBlock.java:95) at org.kohsuke.stapler.jelly.ReallyStaticTagLibrary$1.run(ReallyStaticTagLibrary.java:99) at org.kohsuke.stapler.jelly.ReallyStaticTagLibrary$1.run(ReallyStaticTagLibrary.java:99) at org.apache.commons.jelly.impl.ScriptBlock.run(ScriptBlock.java:95) at org.kohsuke.stapler.jelly.ReallyStaticTagLibrary$1.run(ReallyStaticTagLibrary.java:99) at org.apache.commons.jelly.impl.ScriptBlock.run(ScriptBlock.java:95) at org.kohsuke.stapler.jelly.ReallyStaticTagLibrary$1.run(ReallyStaticTagLibrary.java:99) at org.apache.commons.jelly.impl.ScriptBlock.run(ScriptBlock.java:95) at org.apache.commons.jelly.tags.core.CoreTagLibrary$2.run(CoreTagLibrary.java:105) at org.kohsuke.stapler.jelly.CallTagLibScript.run(CallTagLibScript.java:119) at org.apache.commons.jelly.impl.ScriptBlock.run(ScriptBlock.java:95) at org.kohsuke.stapler.jelly.CompressTag.doTag(CompressTag.java:44) at org.apache.commons.jelly.impl.TagScript.run(TagScript.java:270) at org.kohsuke.stapler.jelly.JellyViewScript.run(JellyViewScript.java:63) at org.kohsuke.stapler.jelly.DefaultScriptInvoker.invokeScript(DefaultScriptInvoker.java:63) {noformat}

    Jenkins JIRA | 6 years ago | Martijn Baay
    java.lang.NullPointerException
  3. 0

    The Build-Pipeline view is empty after upgrading to CopyArtifact 1.15 (from 1.14) and upgrading Build-Pipeline from 1.0 to 1.1.1. Stack trace has a NPE from hudson.plugins.copyartifact.CopyArtifact. WARNING: Caught exception evaluating: from.getBuildPipelineForm(). Reason: java.lang.NullPointerException java.lang.NullPointerException at java.util.TreeMap.putAll(TreeMap.java:290) at hudson.plugins.copyartifact.CopyArtifact$EnvAction.buildEnvVars(CopyArtifact.java:359) at hudson.model.AbstractBuild.getEnvironment(AbstractBuild.java:756) at au.com.centrumsystems.hudson.plugin.buildpipeline.PipelineBuild.getBuildResultURL(PipelineBuild.java:190) at au.com.centrumsystems.hudson.plugin.buildpipeline.BuildForm.<init>(BuildForm.java:66) at au.com.centrumsystems.hudson.plugin.buildpipeline.BuildForm.<init>(BuildForm.java:82) at au.com.centrumsystems.hudson.plugin.buildpipeline.BuildPipelineView.getBuildPipelineForm(BuildPipelineView.java:214) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) 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 hudson.ExpressionFactory2$JexlExpression.evaluate(ExpressionFactory2.java:72) at org.apache.commons.jelly.tags.core.CoreTagLibrary$3.run(CoreTagLibrary.java:134 ... Raised also as an issue on Build-Pipeline: http://code.google.com/p/build-pipeline-plugin/issues/list?thanks=19&ts=1302748637

    Jenkins JIRA | 6 years ago | dmeibusch
    java.lang.NullPointerException
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    A classic case where two plugins work together to cause an error. On the left hand we have the PipelineBuild plugin. This plugin calls {{currentBuild.getEnvironment(null)}} to obtain certain data. This on itself does not actually break something, but I can't imagine calling that method with {{null}} is right. On the right hand we have the CopyArtifact plugin. This plugin introduces a new {{EnvironmentContributingAction}} ("EnvAction") which does not expect a null pointer to be passed. The method mentioned above walks through a list of {{EnvironmentContributingAction}} objects, and calls their {{buildEnvVars}} method. However, because the {{currentBuild.getEnvironment method}} is called with {{null}}, it cannot resolve an {{EnvVars}} object and falls back to {{null}}. That nullpointer is supplied to the CopyArtifact "EnvAction" action which tries to do things with the nullpointer. Obviously that action is causing an error. h5. Links: - [Build Pipeline code|http://code.google.com/p/build-pipeline-plugin/source/browse/src/main/java/au/com/centrumsystems/hudson/plugin/buildpipeline/PipelineBuild.java#414] - [Copy Artifact code|https://github.com/jenkinsci/copyartifact-plugin/blob/master/src/main/java/hudson/plugins/copyartifact/CopyArtifact.java#L359] - [Jenkins combining factor|https://github.com/jenkinsci/jenkins/blob/master/core/src/main/java/hudson/model/AbstractBuild.java#L756] Stacktrace: {noformat} WARNING: Caught exception evaluating: from.getBuildPipelineForm(). Reason: java.lang.NullPointerException java.lang.NullPointerException at java.util.TreeMap.putAll(TreeMap.java:290) at hudson.plugins.copyartifact.CopyArtifact$EnvAction.buildEnvVars(CopyArtifact.java:359) at hudson.model.AbstractBuild.getEnvironment(AbstractBuild.java:756) at au.com.centrumsystems.hudson.plugin.buildpipeline.PipelineBuild.getBuildResultURL(PipelineBuild.java:190) at au.com.centrumsystems.hudson.plugin.buildpipeline.BuildForm.<init>(BuildForm.java:66) at au.com.centrumsystems.hudson.plugin.buildpipeline.BuildForm.<init>(BuildForm.java:82) at au.com.centrumsystems.hudson.plugin.buildpipeline.BuildPipelineView.getBuildPipelineForm(BuildPipelineView.java:214) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) 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 hudson.ExpressionFactory2$JexlExpression.evaluate(ExpressionFactory2.java:72) 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.kohsuke.stapler.jelly.ReallyStaticTagLibrary$1.run(ReallyStaticTagLibrary.java:99) at org.apache.commons.jelly.impl.ScriptBlock.run(ScriptBlock.java:95) at org.kohsuke.stapler.jelly.ReallyStaticTagLibrary$1.run(ReallyStaticTagLibrary.java:99) at org.apache.commons.jelly.impl.ScriptBlock.run(ScriptBlock.java:95) at org.apache.commons.jelly.tags.core.CoreTagLibrary$2.run(CoreTagLibrary.java:105) at org.kohsuke.stapler.jelly.JellyViewScript.run(JellyViewScript.java:63) at org.kohsuke.stapler.jelly.IncludeTag.doTag(IncludeTag.java:146) at org.apache.commons.jelly.impl.TagScript.run(TagScript.java:270) at org.apache.commons.jelly.impl.ScriptBlock.run(ScriptBlock.java:95) at org.kohsuke.stapler.jelly.CallTagLibScript$1.run(CallTagLibScript.java:98) at org.apache.commons.jelly.tags.define.InvokeBodyTag.doTag(InvokeBodyTag.java:91) at org.apache.commons.jelly.impl.TagScript.run(TagScript.java:270) at org.apache.commons.jelly.impl.ScriptBlock.run(ScriptBlock.java:95) at org.apache.commons.jelly.tags.core.CoreTagLibrary$1.run(CoreTagLibrary.java:98) at org.apache.commons.jelly.impl.ScriptBlock.run(ScriptBlock.java:95) at org.apache.commons.jelly.tags.core.CoreTagLibrary$2.run(CoreTagLibrary.java:105) at org.kohsuke.stapler.jelly.CallTagLibScript.run(CallTagLibScript.java:119) at org.apache.commons.jelly.impl.ScriptBlock.run(ScriptBlock.java:95) at org.kohsuke.stapler.jelly.CallTagLibScript$1.run(CallTagLibScript.java:98) at org.apache.commons.jelly.tags.define.InvokeBodyTag.doTag(InvokeBodyTag.java:91) at org.apache.commons.jelly.impl.TagScript.run(TagScript.java:270) at org.apache.commons.jelly.impl.ScriptBlock.run(ScriptBlock.java:95) at org.kohsuke.stapler.jelly.ReallyStaticTagLibrary$1.run(ReallyStaticTagLibrary.java:99) at org.apache.commons.jelly.impl.ScriptBlock.run(ScriptBlock.java:95) at org.kohsuke.stapler.jelly.ReallyStaticTagLibrary$1.run(ReallyStaticTagLibrary.java:99) at org.kohsuke.stapler.jelly.ReallyStaticTagLibrary$1.run(ReallyStaticTagLibrary.java:99) at org.apache.commons.jelly.impl.ScriptBlock.run(ScriptBlock.java:95) at org.kohsuke.stapler.jelly.ReallyStaticTagLibrary$1.run(ReallyStaticTagLibrary.java:99) at org.apache.commons.jelly.impl.ScriptBlock.run(ScriptBlock.java:95) at org.kohsuke.stapler.jelly.ReallyStaticTagLibrary$1.run(ReallyStaticTagLibrary.java:99) at org.apache.commons.jelly.impl.ScriptBlock.run(ScriptBlock.java:95) at org.apache.commons.jelly.tags.core.CoreTagLibrary$2.run(CoreTagLibrary.java:105) at org.kohsuke.stapler.jelly.CallTagLibScript.run(CallTagLibScript.java:119) at org.apache.commons.jelly.impl.ScriptBlock.run(ScriptBlock.java:95) at org.kohsuke.stapler.jelly.CompressTag.doTag(CompressTag.java:44) at org.apache.commons.jelly.impl.TagScript.run(TagScript.java:270) at org.kohsuke.stapler.jelly.JellyViewScript.run(JellyViewScript.java:63) at org.kohsuke.stapler.jelly.DefaultScriptInvoker.invokeScript(DefaultScriptInvoker.java:63) {noformat}

    Jenkins JIRA | 6 years ago | Martijn Baay
    java.lang.NullPointerException
  6. 0

    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 java.util.TreeMap.putAll()
    2. Java RT
      TreeMap.putAll
      1. java.util.TreeMap.putAll(TreeMap.java:290)
      1 frame
    3. hudson.plugins.copyartifact
      CopyArtifact$EnvAction.buildEnvVars
      1. hudson.plugins.copyartifact.CopyArtifact$EnvAction.buildEnvVars(CopyArtifact.java:359)
      1 frame
    4. Hudson
      AbstractBuild.getEnvironment
      1. hudson.model.AbstractBuild.getEnvironment(AbstractBuild.java:756)
      1 frame
    5. au.com.centrumsystems
      BuildPipelineView.getBuildPipelineForm
      1. au.com.centrumsystems.hudson.plugin.buildpipeline.PipelineBuild.getBuildResultURL(PipelineBuild.java:190)
      2. au.com.centrumsystems.hudson.plugin.buildpipeline.BuildForm.<init>(BuildForm.java:66)
      3. au.com.centrumsystems.hudson.plugin.buildpipeline.BuildForm.<init>(BuildForm.java:82)
      4. au.com.centrumsystems.hudson.plugin.buildpipeline.BuildPipelineView.getBuildPipelineForm(BuildPipelineView.java:214)
      4 frames
    6. Java RT
      Method.invoke
      1. sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      2. sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      3. sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      4. java.lang.reflect.Method.invoke(Method.java:597)
      4 frames
    7. 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
    8. Hudson
      ExpressionFactory2$JexlExpression.evaluate
      1. hudson.ExpressionFactory2$JexlExpression.evaluate(ExpressionFactory2.java:72)
      1 frame