Getting Error Jacco- ANT

120 views
Skip to first unread message

Petluri Srinivasa Chakravarthi

unread,
Jul 8, 2022, 2:56:57 AM7/8/22
to JaCoCo and EclEmma Users
Hello,
       I a m getting following error while integrating Jacoco in ANT.
java.lang.instrument.IllegalClassFormatException: Error while instrumenting org/apache/logging/log4j/spi/AbstractLogger with JaCoCo 0.8.8.202204050719/5dcf34a.

used Log4j Jars:
log4j-api-2.15.0.jar and log4j-api-2.15.0.jar
Jacoco version used 0.8.8

Regards,
Srinivas P.

Marc Hoffmann

unread,
Jul 8, 2022, 6:10:40 PM7/8/22
to JaCoCo and EclEmma Users
Hi Srinivas,

can you please provide the full stack trace?

Thanks,
-marc

Petluri Srinivasa Chakravarthi

unread,
Jul 10, 2022, 11:24:36 PM7/10/22
to jac...@googlegroups.com

Hello Marc,

              Thank for responding. Please find the attached error file. But same code is executing from eclipse

without any error using EclEmma V3.1.0. Junit tests are running similarly in both(ANT and eclipse)  Only facing issue with code coverage report. ANT(Jacoco) generated report is showing 0% for entire project. I tried with offline instrumenting too.

           

Thanks in Advance.

 

Regards,

Srinivas P.

 

From: jac...@googlegroups.com <jac...@googlegroups.com> On Behalf Of Marc Hoffmann
Sent: 09 July 2022 03:41
To: JaCoCo and EclEmma Users <jac...@googlegroups.com>
Subject: [java code coverage] Re: Getting Error Jacco- ANT

 

You don't often get email from marc.h...@mtrail.ch. Learn why this is important

--
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/RelQPhYOe_0/unsubscribe.
To unsubscribe from this group and all its topics, send an email to jacoco+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jacoco/07bc5d4c-65a7-47ee-97c2-bd075f33260fn%40googlegroups.com.

Error.txt

Marc Hoffmann

unread,
Jul 11, 2022, 5:32:27 AM7/11/22
to JaCoCo and EclEmma Users
Hi Srinivas,

the interesting part of the stack trace is here:

    [junit] Caused by: java.lang.ArrayIndexOutOfBoundsException: 287
    [junit] at org.jacoco.agent.rt.internal_b6258fc.asm.ClassReader.readUtf(ClassReader.java:3695)
    [junit] at org.jacoco.agent.rt.internal_b6258fc.asm.ClassReader.readUtf(ClassReader.java:3675)
    [junit] at org.jacoco.agent.rt.internal_b6258fc.asm.ClassReader.readUTF8(ClassReader.java:3656)
    [junit] at org.jacoco.agent.rt.internal_b6258fc.asm.ClassReader.readMethod(ClassReader.java:1388)

The ASM library cannot read the class file. This is most likely because the class file has a syntax error. This can be because the class file was compiled with an error (actually some javac versions created invalid class files) or there is another agent which modifies the class files in an invalid way.

Can you please provide the class file org/apache/logging/log4j/spi/AbstractLogger.class which is used in your build? To be sure you can add the classdumpdir option (https://www.jacoco.org/jacoco/trunk/doc/agent.html) so you will get the exact version of the class file which is seen by the JaCoCO agent.

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/BMXPR01MB077529827C0D047AE4FAA7F199879%40BMXPR01MB0775.INDPRD01.PROD.OUTLOOK.COM.
<Error.txt>

Reply all
Reply to author
Forward
0 new messages