The exception message says: "Can't add different class with same name:
com/fasterxml/jackson/annotation/JsonFormat$Shape" 

Please see FAQ: http://www.jacoco.org/jacoco/trunk/doc/faq.html 

WHY DO I GET THE ERROR "CAN'T ADD DIFFERENT CLASS WITH SAME NAME"?

For coverage report generation all classes within a group must have
unique names. You get this error during report generation if JaCoCo is
supplied with multiple different class files with the same name. To fix
this remove those duplicate classes or create separate reports or report
groups for each version. 

Note that it is not possible to create groups with the command line
tool. You need to decide which version of the class you want to create a
coverage report for. 

Regards,
-marc 

On 2018-01-11 13:11, Sabyasachi Mishra wrote:

> Below is the exception I am getting 
> 
> [INFO] Loading execution data file /opt/jacoco/Result/jacoco.exec. 
> Exception in thread "main" java.io.IOException: Error while analyzing 
> /opt/jacoco/Result/classes/com/fasterxml/jackson/annotation/JsonFormat$Shape.4e5c4d9a972b70b0.class.
>  
> at 
> org.jacoco.cli.internal.core.analysis.Analyzer.analyzerError(Analyzer.java:157)
>  
> at 
> org.jacoco.cli.internal.core.analysis.Analyzer.analyzeClass(Analyzer.java:129)
>  
> at 
> org.jacoco.cli.internal.core.analysis.Analyzer.analyzeClass(Analyzer.java:152)
>  
> at 
> org.jacoco.cli.internal.core.analysis.Analyzer.analyzeAll(Analyzer.java:188) 
> at 
> org.jacoco.cli.internal.core.analysis.Analyzer.analyzeAll(Analyzer.java:221) 
> at 
> org.jacoco.cli.internal.core.analysis.Analyzer.analyzeAll(Analyzer.java:216) 
> at 
> org.jacoco.cli.internal.core.analysis.Analyzer.analyzeAll(Analyzer.java:216) 
> at 
> org.jacoco.cli.internal.core.analysis.Analyzer.analyzeAll(Analyzer.java:216) 
> at 
> org.jacoco.cli.internal.core.analysis.Analyzer.analyzeAll(Analyzer.java:216) 
> at 
> org.jacoco.cli.internal.core.analysis.Analyzer.analyzeAll(Analyzer.java:216) 
> at org.jacoco.cli.internal.commands.Report.analyze(Report.java:109) 
> at org.jacoco.cli.internal.commands.Report.execute(Report.java:83) 
> at org.jacoco.cli.internal.Main.execute(Main.java:89) 
> at org.jacoco.cli.internal.Main.main(Main.java:104) 
> Caused by: java.lang.IllegalStateException: Can't add different class with 
> same name: com/fasterxml/jackson/annotation/JsonFormat$Shape 
> at 
> org.jacoco.cli.internal.core.analysis.CoverageBuilder.visitCoverage(CoverageBuilder.java:107)
>  
> at 
> org.jacoco.cli.internal.core.analysis.Analyzer$1.visitEnd(Analyzer.java:96) 
> at org.jacoco.cli.internal.asm.ClassVisitor.visitEnd(ClassVisitor.java:339) 
> at 
> org.jacoco.cli.internal.core.internal.flow.ClassProbesAdapter.visitEnd(ClassProbesAdapter.java:98)
>  
> at org.jacoco.cli.internal.asm.ClassReader.accept(ClassReader.java:702) 
> at org.jacoco.cli.internal.asm.ClassReader.accept(ClassReader.java:500) 
> at 
> org.jacoco.cli.internal.core.analysis.Analyzer.analyzeClass(Analyzer.java:111)
>  
> at 
> org.jacoco.cli.internal.core.analysis.Analyzer.analyzeClass(Analyzer.java:127)
>  
> ... 12 more 
> 
> On Thursday, 11 January 2018 17:34:58 UTC+5:30, Marc R. Hoffmann wrote: 
> 
> Can you please provide the full exception stack trace thrown from the command 
> line tool? 
> 
> Regards,
> -marc 
> 
> On 2018-01-11 12:59, Sabyasachi Mishra wrote: 
> Hello team, 
> 
> I am trying to compute code coverage for a build hosted in tomcat. I have 
> attached Jacoco agent to tomcat using Java agent. Now I am able to get 
> Jacoco.exec file and class dumps. Currently I don't have access to source 
> code files. 
> As  per as my understanding we can do the analysis only by using *.class 
> files and Jacoco.exec files. I have tried the below options but still not 
> able to generate the html report. 
> 
> java -jar /opt/jacoco/lib/jacococli.jar report /opt/jacoco/Result/jacoco.exec 
> --classfiles /opt/jacoco/Result/classes --html 
> /opt/jacoco/Result/jacoco-report --name jackRpt - This is thrrowing me an 
> exception 
> 
> I have also tried import the jacoco.exec file and analysed against the class 
> dump files. But I am getting error code of 5001.  
> 
> Can anyone please tell me what I am missing or what I am doing wrong. 
> 
> Thanks in advance. 
> 
> Regards, 
> Sabyasachi Mishra  
> 
> -- 
> 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 [email protected].
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/jacoco/e33d2823-d507-4d6a-9240-ad247e7b4b2b%40googlegroups.com
>  [1].
> For more options, visit https://groups.google.com/d/optout [2].

  -- 
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 [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/jacoco/58efd77e-6ab5-40e1-8f1f-d91dacfc1cf7%40googlegroups.com
[3].
For more options, visit https://groups.google.com/d/optout. 

  

Links:
------
[1]
https://groups.google.com/d/msgid/jacoco/e33d2823-d507-4d6a-9240-ad247e7b4b2b%40googlegroups.com?utm_medium=email&utm_source=footer
[2] https://groups.google.com/d/optout
[3]
https://groups.google.com/d/msgid/jacoco/58efd77e-6ab5-40e1-8f1f-d91dacfc1cf7%40googlegroups.com?utm_medium=email&utm_source=footer

-- 
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 [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jacoco/096f8f118ce14f8ba032c874a47f88bd%40mountainminds.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to