Jacoc Agent java.lang.instrument.IllegalClassFormatException: Error while instrumenting class

281 views
Skip to first unread message

catc...@gmail.com

unread,
Feb 8, 2017, 11:23:56 PM2/8/17
to JaCoCo and EclEmma Users
I am getting the below error when tomcat starts. I have configured the jvm argument as

-javaagent:/xxxx/xxx/xxx/jacocoagent.jar=append=true,output=tcpserver,address=xxxxxx,port=xxxxx,excludes=org.sonar.api.*:org.sonar.core.*:org.sonar.jpa.*:com.xxxx.*:oracle.*:org.spring.*,includes=com.xxxx.*


java.lang.instrument.IllegalClassFormatException: Error while instrumenting class com/xxx/xxx/xxx/xxx/xxxxx

Caused by: java.io.IOException: Error while instrumenting class com/xxx/xxx/xxx/xxx/xxxxx.
at org.jacoco.agent.rt.internal_e6e56f0.core.instr.Instrumenter.instrumentError(Instrumenter.java:152)
at org.jacoco.agent.rt.internal_e6e56f0.core.instr.Instrumenter.instrument(Instrumenter.java:103)
at org.jacoco.agent.rt.internal_e6e56f0.CoverageTransformer.transform(CoverageTransformer.java:87)
... 62 more
Caused by: java.lang.ArrayIndexOutOfBoundsException

Evgeny Mandrikov

unread,
Feb 9, 2017, 5:08:58 AM2/9/17
to JaCoCo and EclEmma Users, catc...@gmail.com
Hi,

I'm guessing that you use JaCoCo version 0.7.2, which is quite old (2 years old), so please try latest version, that is 0.7.9 as of today.

If this won't solve problem, then please provide:
  • at least full stack trace, i.e. without truncation after ArrayIndexOutOfBoundsException
  • version of JVM
  • and ideally class file that can't be instrumented
If you are not seeing full stack trace, then most likely this is a result of optimization in JVM and in order to get it fully you should use JVM option "-XX:-OmitStackTraceInFastThrow".


P.S. it is a good practice to always use latest version and specify version when reporting about problems
Reply all
Reply to author
Forward
This conversation is locked
You cannot reply and perform actions on locked conversations.
0 new messages