Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NPE in MethodAnalyzer.java:287 #222

Closed
mhankus opened this issue Jun 16, 2014 · 6 comments
Closed

NPE in MethodAnalyzer.java:287 #222

mhankus opened this issue Jun 16, 2014 · 6 comments
Labels
declined: otherproject 👽 This issue should be reported to other project

Comments

@mhankus
Copy link

mhankus commented Jun 16, 2014

Jacoco is run from jenkins job, and fails with NPE in MethodAnalyzer.java:287.
I'm using 0.7.1.201405082137

ERROR: Publisher hudson.plugins.jacoco.JacocoPublisher aborted due to exception
java.io.IOException: Error while analyzing class PATH_TO_SOME_FILE.class.
    at org.jacoco.core.analysis.Analyzer.analyzerError(Analyzer.java:150)
    at org.jacoco.core.analysis.Analyzer.analyzeClass(Analyzer.java:144)
    at org.jacoco.core.analysis.Analyzer.analyzeAll(Analyzer.java:175)
    at org.jacoco.core.analysis.Analyzer.analyzeAll(Analyzer.java:208)
    at hudson.plugins.jacoco.ExecutionFileLoader.analyzeStructure(ExecutionFileLoader.java:130)
    at hudson.plugins.jacoco.ExecutionFileLoader.loadBundleCoverage(ExecutionFileLoader.java:137)
    at hudson.plugins.jacoco.JacocoReportDir.parse(JacocoReportDir.java:102)
    at hudson.plugins.jacoco.JacocoBuildAction.loadRatios(JacocoBuildAction.java:291)
    at hudson.plugins.jacoco.JacocoBuildAction.load(JacocoBuildAction.java:273)
    at hudson.plugins.jacoco.JacocoPublisher.perform(JacocoPublisher.java:371)
    at hudson.tasks.BuildStepMonitor$3.perform(BuildStepMonitor.java:45)
    at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:756)
    at hudson.model.AbstractBuild$AbstractBuildExecution.performAllBuildSteps(AbstractBuild.java:720)
    at hudson.maven.MavenModuleSetBuild$MavenModuleSetBuildExecution.post2(MavenModuleSetBuild.java:1040)
    at hudson.model.AbstractBuild$AbstractBuildExecution.post(AbstractBuild.java:669)
    at hudson.model.Run.execute(Run.java:1735)
    at hudson.maven.MavenModuleSetBuild.run(MavenModuleSetBuild.java:529)
    at hudson.model.ResourceController.execute(ResourceController.java:88)
    at hudson.model.Executor.run(Executor.java:234)
Caused by: java.lang.NullPointerException
    at org.jacoco.core.internal.analysis.MethodAnalyzer.addProbe(MethodAnalyzer.java:287)
    at org.jacoco.core.internal.analysis.MethodAnalyzer.visitProbe(MethodAnalyzer.java:210)
    at org.jacoco.core.internal.flow.MethodProbesAdapter.visitLabel(MethodProbesAdapter.java:61)
    at org.objectweb.asm.tree.LabelNode.accept(Unknown Source)
    at org.objectweb.asm.tree.InsnList.accept(Unknown Source)
    at org.objectweb.asm.tree.MethodNode.accept(Unknown Source)
    at org.jacoco.core.internal.flow.ClassProbesAdapter$1.visitEnd(ClassProbesAdapter.java:124)
    at org.objectweb.asm.ClassReader.readMethod(ClassReader.java:1021)
    at org.objectweb.asm.ClassReader.accept(ClassReader.java:693)
    at org.objectweb.asm.ClassReader.accept(ClassReader.java:506)
    at org.jacoco.core.analysis.Analyzer.analyzeClass(Analyzer.java:107)
    at org.jacoco.core.analysis.Analyzer.analyzeClass(Analyzer.java:142)
    ... 17 more
Skipping sonar analysis due to bad build status FAILURE

@marchof
Copy link
Member

marchof commented Jun 16, 2014

@mhankus Thanks for reporting this. Any chance that we can get the "PATH_TO_SOME_FILE.class" for further analysis? If you can't share this here please sent it to my last name at mountainminds.com.

@marchof
Copy link
Member

marchof commented Jun 17, 2014

@mhankus Thx for providing the class file. Unfortunately I cannot reproduce the problem. Can you please double check that you provided the exact same class file directly from the build process where the problem occurs (target/classes)?

@bill-lin
Copy link

We got exactly the same error after upgrade jenkins jacoco plugin to 1.0.14. I will email you a sample class t

@marchof
Copy link
Member

marchof commented Jun 21, 2014

@mhankus @bill-lin Thanks for providing sample classes! Unfortunately I cannot reproduce this issue. My guess is that this is a Jenkins specific problem (e.g. wrong ASM version).

Are you able to create a regular JaCoCo coverage report without Jenkins?

@Godin
Copy link
Member

Godin commented Jun 23, 2014

@mhankus @bill-lin @marchof indeed - seems that there is mess in ASM dependencies in Jenkins plugin: https://github.com/jenkinsci/jacoco-plugin/blob/master/pom.xml#L97 At least because it depends on 4.x , whereas JaCoCo 0.7.1 uses 5.x. I can open PR or even push changes directly into Jenkins plugin, but unfortunately don't have time to test it properly.

@marchof
Copy link
Member

marchof commented Jun 23, 2014

@Godin Thanks for the analysis! I tried to run JaCoCo 0.7.1 with ASM 4.x and got the following error:

https://issues.jenkins-ci.org/browse/JENKINS-23426

Anyways I close this issue here for JaCoCo.

@mhankus @bill-lin Can you please report the problem to the Jenkins plug-in maintainer? https://wiki.jenkins-ci.org/display/JENKINS/JaCoCo+Plugin

@marchof marchof closed this as completed Jun 23, 2014
@jacoco jacoco locked and limited conversation to collaborators Jan 11, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
declined: otherproject 👽 This issue should be reported to other project
Projects
None yet
Development

No branches or pull requests

4 participants