running jacoco examples

294 views
Skip to first unread message

Alexander Shyrokov

unread,
Feb 8, 2014, 8:39:14 PM2/8/14
to jac...@googlegroups.com
I downloaded jacoco-0.6.4 and ASM 4.1 and CoreTutorial.java. I created an eclipse project in which I referenced all the jar files in jacoco and asm and the only source file is CoreTutorial.java. I get the following exception:

Exception in thread "main" java.lang.AbstractMethodError: org.jacoco.core.runtime.LoggerRuntime.generateDataAccessor(JLjava/lang/String;ILorg/jacoco/asm/MethodVisitor;)I
at org.jacoco.core.internal.instr.ClassInstrumenter$ClassTypeStrategy.genInitializeDataField(ClassInstrumenter.java:189)
at org.jacoco.core.internal.instr.ClassInstrumenter$ClassTypeStrategy.createInitMethod(ClassInstrumenter.java:163)
at org.jacoco.core.internal.instr.ClassInstrumenter$ClassTypeStrategy.addMembers(ClassInstrumenter.java:133)
at org.jacoco.core.internal.instr.ClassInstrumenter.visitEnd(ClassInstrumenter.java:116)
at org.jacoco.asm.ClassVisitor.visitEnd(Unknown Source)
at org.jacoco.core.internal.flow.ClassProbesAdapter.visitEnd(ClassProbesAdapter.java:135)
at org.jacoco.asm.ClassReader.accept(Unknown Source)
at org.jacoco.asm.ClassReader.accept(Unknown Source)
at org.jacoco.core.instr.Instrumenter.instrument(Instrumenter.java:78)
at org.jacoco.core.instr.Instrumenter.instrument(Instrumenter.java:117)
at org.jacoco.examples.CoreTutorial.execute(CoreTutorial.java:116)
at org.jacoco.examples.CoreTutorial.main(CoreTutorial.java:196)

I did see a post that asked about this exception, but the suggestion was to check if the version of ASM is correct. It is 4.1 as stated by documentation and that's what I downloaded. What am I doing wrong? I tried java 7 and java 6.

Thanks!

Marc R. Hoffmann

unread,
Feb 9, 2014, 12:49:48 AM2/9/14
to jac...@googlegroups.com
Hi,

it looks like you're using the all-in-one JAR jacocoant.jar on your class path. This contains a shaded version of ASM and cannot be used to for development.

Please use the libraries org.jacoco.core and or.jacoco.report to compile and run the examples.

Best 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.
For more options, visit https://groups.google.com/groups/opt_out.


Alexander Shyrokov

unread,
Feb 9, 2014, 10:50:40 AM2/9/14
to jac...@googlegroups.com

it looks like you're using the all-in-one JAR jacocoant.jar on your class path. This contains a shaded version of ASM and cannot be used to for development.
 Great! I removed jacocoagent.jar and jacocoant.jar from my build path and the example started to work. Thanks a lot. I assume you have seen this problem before, because I can not see how I could have deducted that information from the exception trace.

Marc R. Hoffmann

unread,
Feb 9, 2014, 3:23:48 PM2/9/14
to jac...@googlegroups.com
No, this problem has not been reported before. It actuall took me some moments to spot the problem, but if you look closely at the exception message you will notice the type org/jacoco/asm/MethodVisitor in the signature which does only exist in the shaded version of the Ant jar.

Here you find a description of all JARs: http://www.eclemma.org/jacoco/trunk/index.html

Cheers,
-marc


 

On 09.02.14 16:50, Alexander Shyrokov wrote:

Alexander Shyrokov

unread,
Feb 9, 2014, 8:42:45 PM2/9/14
to jac...@googlegroups.com
I see. That makes sense now. Thanks for your help.

Thanks,
Alexander
> No virus found in this message.
> Checked by AVG - www.avg.com <http://www.avg.com>
> Version: 2013.0.3462 / Virus Database: 3697/7079 - Release Date: 02/09/14
>
> --
> You received this message because you are subscribed to a topic in the
> Google Groups "JaCoCo and EclEmma Users" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/jacoco/LNds3sbsGU4/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to
Reply all
Reply to author
Forward
This conversation is locked
You cannot reply and perform actions on locked conversations.
0 new messages