JaCoCo report problem

562 views
Skip to first unread message

Helko Glathe

unread,
Feb 18, 2016, 10:29:16 AM2/18/16
to JaCoCo and EclEmma Users

Hello,

I adapted the ReportGenerator example to use JaCoCo code coverage report without Maven etc. in plain Java.
http://eclemma.org/jacoco/trunk/coverage/org.jacoco.examples/org.jacoco.examples/ReportGenerator.java.html

For the classes/bin option I referenced a folder where underneath all plugins and classes folders are located to run the product we have. Lots of them are from org.eclipse or org.apache.

For some of those 3rd party jar libs I get such problems when running the JaCoCo analyzer:
Let's go with the JaCoCo integration test code coverage report!
3 JaCoCo exec files found.
Exception in thread "main" java.io.IOException: Error while analyzing class C:\Standalone\Workspace\products\plugins\org.apache.xmlbeans_2.3.0.v201405241900.jar@javax/xml/namespace/QName.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.analyzeZip(Analyzer.java:246)
    at org.jacoco.core.analysis.Analyzer.analyzeAll(Analyzer.java:178)
    at org.jacoco.core.analysis.Analyzer.analyzeAll(Analyzer.java:208)
    at org.jacoco.core.analysis.Analyzer.analyzeAll(Analyzer.java:203)
    at jacocoreporter.ReportGenerator.analyzeStructure(ReportGenerator.java:142)
    at jacocoreporter.ReportGenerator.create(ReportGenerator.java:98)
    at jacocoreporter.ReportGenerator.main(ReportGenerator.java:163)
Caused by: java.lang.IllegalStateException: Can't add different class with same name: javax/xml/namespace/QName
    at org.jacoco.core.analysis.CoverageBuilder.visitCoverage(CoverageBuilder.java:106)
    at org.jacoco.core.analysis.Analyzer$1.visitEnd(Analyzer.java:92)
    at org.jacoco.asm.ClassVisitor.visitEnd(ClassVisitor.java:317)
    at org.jacoco.core.internal.flow.ClassProbesAdapter.visitEnd(ClassProbesAdapter.java:98)
    at org.jacoco.asm.ClassReader.accept(ClassReader.java:697)
    at org.jacoco.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)
    ... 8 more

when I remove those problematic jar lib files from the folder the analyzer runs without problems.
Is there an option to ignore certain jar libs or does anybody have an idea how else I can solve this problem?

Thanks in advance and kind regards.

Helko

Marc R. Hoffmann

unread,
Feb 21, 2016, 11:38:06 AM2/21/16
to jac...@googlegroups.com
Hi Helko,

the provided example is very simple and considers all JARs under a certain directory. You may traverse and filter your JAR files (e.g. only application JARs) and feed them to the Analyzer.

Regards,
-marc
--
You received this message because you are subscribed to the Google Groups "JaCoCo and EclEmma Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jacoco+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jacoco/370dce60-9b12-44f6-92ee-8561cba841ad%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
This conversation is locked
You cannot reply and perform actions on locked conversations.
0 new messages