What you are doing seems right. 

Looks like the build in question did not run cobertura .

On Monday, August 17, 2015 at 8:11:32 AM UTC-5, Prasanth Thampi wrote:
>
> My groovy script is failing due to null pointer error. 
>
> can any one help me in understanding what to be fixed
>
> ~~~
>
> *build.getAction(hudson.plugins.cobertura.CoberturaBuildAction.class).getLineCoverage().getPercentageFloat();*
> ~~~
>
>
> *Groovy script failed:*
>
> java.lang.NullPointerException: Cannot invoke method getLineCoverage() on 
> null object
>       at 
> org.codehaus.groovy.runtime.NullObject.invokeMethod(NullObject.java:77)
>       at 
> org.codehaus.groovy.runtime.callsite.PogoMetaClassSite.call(PogoMetaClassSite.java:45)
>       at 
> org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:42)
>       at 
> org.codehaus.groovy.runtime.callsite.NullCallSite.call(NullCallSite.java:32)
>       at 
> org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:42)
>       at 
> org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:108)
>       at 
> org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:112)
>       at Script1.coverage(Script1.groovy:5)
>       at Script1$coverage.callCurrent(Unknown Source)
>       at 
> org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCallCurrent(CallSiteArray.java:46)
>       at 
> org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:133)
>       at 
> org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:141)
>       at Script1.run(Script1.groovy:19)
>       at groovy.lang.GroovyShell.evaluate(GroovyShell.java:580)
>       at groovy.lang.GroovyShell.evaluate(GroovyShell.java:618)
>       at groovy.lang.GroovyShell.evaluate(GroovyShell.java:589)
>       at 
> org.jenkinsci.plugins.scriptsecurity.sandbox.groovy.SecureGroovyScript.evaluate(SecureGroovyScript.java:166)
>       at 
> org.jvnet.hudson.plugins.groovypostbuild.GroovyPostbuildRecorder.perform(GroovyPostbuildRecorder.java:361)
>       at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:20)
>       at 
> hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:770)
>       at 
> hudson.model.AbstractBuild$AbstractBuildExecution.performAllBuildSteps(AbstractBuild.java:734)
>       at hudson.model.Build$BuildExecution.post2(Build.java:183)
>       at 
> hudson.model.AbstractBuild$AbstractBuildExecution.post(AbstractBuild.java:683)
>       at hudson.model.Run.execute(Run.java:1784)
>       at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
>       at hudson.model.ResourceController.execute(ResourceController.java:89)
>       at hudson.model.Executor.run(Executor.java:240)
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-dev/f30d32fa-8436-4b43-b795-1f85cad75062%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to