java.lang.NullPointerException

Jenkins JIRA | Marco Clemencic | 4 years ago
  1. 0

    Hi, I've been happily using the Groovy plugin 1.12 to execute some complex code in the macro expansion. Unfortunately, in 1.13 it does not work anymore. This is what I get in the output of a job: {code} FATAL: null java.lang.NullPointerException at java.util.Hashtable.put(Hashtable.java:542) at groovy.lang.Binding.setVariable(Binding.java:77) at groovy.lang.GroovyShell.setVariable(GroovyShell.java:568) at hudson.plugins.groovy.SystemGroovy.perform(SystemGroovy.java:76) at hudson.plugins.groovy.GroovyTokenMacro.evaluate(GroovyTokenMacro.java:68) at org.jenkinsci.plugins.tokenmacro.DataBoundTokenMacro.evaluate(DataBoundTokenMacro.java:177) at org.jenkinsci.plugins.tokenmacro.TokenMacro.expand(TokenMacro.java:177) at org.jenkinsci.plugins.tokenmacro.TokenMacro.expand(TokenMacro.java:153) at org.jenkinsci.plugins.buildnamesetter.BuildNameSetter.setDisplayName(BuildNameSetter.java:50) at org.jenkinsci.plugins.buildnamesetter.BuildNameSetter.setUp(BuildNameSetter.java:37) at hudson.model.Build$BuildExecution.doRun(Build.java:154) at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:593) at hudson.model.Run.execute(Run.java:1567) at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:46) at hudson.model.ResourceController.execute(ResourceController.java:88) at hudson.model.Executor.run(Executor.java:237) {code} For the test I used the [Build Name Setter|http://wiki.jenkins-ci.org/display/JENKINS/Build+Name+Setter+Plugin] plugin with the option {code} ${GROOVY,script="return 'build_name'"} {code} but the failure is reproducible with anything that call token expansion and with any Groovy code (I use something more complex than that in my real jobs). To be able to work I had to revert 1.12, but I would profit from the change in 1.13 because I actually need to manipulate an environment variable in the token. Thanks Marco

    Jenkins JIRA | 4 years ago | Marco Clemencic
    java.lang.NullPointerException
  2. 0

    Hi, I've been happily using the Groovy plugin 1.12 to execute some complex code in the macro expansion. Unfortunately, in 1.13 it does not work anymore. This is what I get in the output of a job: {code} FATAL: null java.lang.NullPointerException at java.util.Hashtable.put(Hashtable.java:542) at groovy.lang.Binding.setVariable(Binding.java:77) at groovy.lang.GroovyShell.setVariable(GroovyShell.java:568) at hudson.plugins.groovy.SystemGroovy.perform(SystemGroovy.java:76) at hudson.plugins.groovy.GroovyTokenMacro.evaluate(GroovyTokenMacro.java:68) at org.jenkinsci.plugins.tokenmacro.DataBoundTokenMacro.evaluate(DataBoundTokenMacro.java:177) at org.jenkinsci.plugins.tokenmacro.TokenMacro.expand(TokenMacro.java:177) at org.jenkinsci.plugins.tokenmacro.TokenMacro.expand(TokenMacro.java:153) at org.jenkinsci.plugins.buildnamesetter.BuildNameSetter.setDisplayName(BuildNameSetter.java:50) at org.jenkinsci.plugins.buildnamesetter.BuildNameSetter.setUp(BuildNameSetter.java:37) at hudson.model.Build$BuildExecution.doRun(Build.java:154) at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:593) at hudson.model.Run.execute(Run.java:1567) at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:46) at hudson.model.ResourceController.execute(ResourceController.java:88) at hudson.model.Executor.run(Executor.java:237) {code} For the test I used the [Build Name Setter|http://wiki.jenkins-ci.org/display/JENKINS/Build+Name+Setter+Plugin] plugin with the option {code} ${GROOVY,script="return 'build_name'"} {code} but the failure is reproducible with anything that call token expansion and with any Groovy code (I use something more complex than that in my real jobs). To be able to work I had to revert 1.12, but I would profit from the change in 1.13 because I actually need to manipulate an environment variable in the token. Thanks Marco

    Jenkins JIRA | 4 years ago | Marco Clemencic
    java.lang.NullPointerException
  3. Speed up your debug routine!

    Automated exception search integrated into your IDE

  4. 0

    Universal wiki Converter throws Out Of Memory Error

    Stack Overflow | 4 years ago | kamal
    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 java.util.Hashtable.put()
  2. Java RT
    Hashtable.put
    1. java.util.Hashtable.put(Hashtable.java:542)
    1 frame
  3. Groovy
    GroovyShell.setVariable
    1. groovy.lang.Binding.setVariable(Binding.java:77)
    2. groovy.lang.GroovyShell.setVariable(GroovyShell.java:568)
    2 frames
  4. Hudson Groovy builder
    GroovyTokenMacro.evaluate
    1. hudson.plugins.groovy.SystemGroovy.perform(SystemGroovy.java:76)
    2. hudson.plugins.groovy.GroovyTokenMacro.evaluate(GroovyTokenMacro.java:68)
    2 frames
  5. Token Macro Plugin
    TokenMacro.expand
    1. org.jenkinsci.plugins.tokenmacro.DataBoundTokenMacro.evaluate(DataBoundTokenMacro.java:177)
    2. org.jenkinsci.plugins.tokenmacro.TokenMacro.expand(TokenMacro.java:177)
    3. org.jenkinsci.plugins.tokenmacro.TokenMacro.expand(TokenMacro.java:153)
    3 frames
  6. org.jenkinsci.plugins
    BuildNameSetter.setUp
    1. org.jenkinsci.plugins.buildnamesetter.BuildNameSetter.setDisplayName(BuildNameSetter.java:50)
    2. org.jenkinsci.plugins.buildnamesetter.BuildNameSetter.setUp(BuildNameSetter.java:37)
    2 frames
  7. Hudson
    Executor.run
    1. hudson.model.Build$BuildExecution.doRun(Build.java:154)
    2. hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:593)
    3. hudson.model.Run.execute(Run.java:1567)
    4. hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:46)
    5. hudson.model.ResourceController.execute(ResourceController.java:88)
    6. hudson.model.Executor.run(Executor.java:237)
    6 frames