offline instrumentation issue !!!

1,213 views
Skip to first unread message

yajvane

unread,
Nov 15, 2016, 1:40:48 AM11/15/16
to JaCoCo and EclEmma Users
Hi,
Trying to instrument using command "mvn org.jacoco:jacoco-maven-plugin:instrument" & here is the exception thrown.

[ERROR] Failed to execute goal org.jacoco:jacoco-maven-plugin:0.7.7.201606060606:instrument (default-cli) on project PSP-Commons: Unable to instrument file. Error while instrumenting class /workspace/mbagalko_denalibr/psc/branches/psc_denali_br/psp/src/psp/components/commons/target/classes/com/cisco/epm/pap/api/services/persistance/dao/ConfigDAO.class. java.lang.ClassNotFoundException: com.cisco.epm.pap.api.vo.AuthenticationConfig -> [Help 1]

org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.jacoco:jacoco-maven-plugin:0.7.7.201606060606:instrument (default-cli) on project PSP-Commons: Unable to instrument file.

               at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:212)

               at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)

               at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)

               at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:116)

               at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:80)

               at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:51)

               at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:128)

               at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:307)

               at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:193)

               at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:106)

               at org.apache.maven.cli.MavenCli.execute(MavenCli.java:863)

               at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:288)

               at org.apache.maven.cli.MavenCli.main(MavenCli.java:199)

               at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

               at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)

               at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

               at java.lang.reflect.Method.invoke(Method.java:483)

               at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289)

               at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229)

               at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415)

               at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356)

Caused by: org.apache.maven.plugin.MojoExecutionException: Unable to instrument file.

               at org.jacoco.maven.InstrumentMojo.executeMojo(InstrumentMojo.java:85)

               at org.jacoco.maven.AbstractJacocoMojo.execute(AbstractJacocoMojo.java:63)

               at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:134)

               at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:207)

               ... 20 more

Caused by: java.io.IOException: Error while instrumenting class /workspace/mbagalko_denalibr/psc/branches/psc_denali_br/psp/src/psp/components/commons/target/classes/com/cisco/epm/pap/api/services/persistance/dao/ConfigDAO.class.

               at org.jacoco.core.instr.Instrumenter.instrumentError(Instrumenter.java:160)

               at org.jacoco.core.instr.Instrumenter.instrument(Instrumenter.java:111)

               at org.jacoco.core.instr.Instrumenter.instrument(Instrumenter.java:152)

               at org.jacoco.maven.InstrumentMojo.executeMojo(InstrumentMojo.java:83)

               ... 23 more

Caused by: java.lang.RuntimeException: java.lang.ClassNotFoundException: com.cisco.epm.pap.api.vo.AuthenticationConfig

               at org.objectweb.asm.ClassWriter.getCommonSuperClass(ClassWriter.java:1719)

               at org.objectweb.asm.ClassWriter.getMergedType(ClassWriter.java:1689)

               at org.objectweb.asm.Frame.merge(Frame.java:1426)

               at org.objectweb.asm.Frame.merge(Frame.java:1325)

               at org.objectweb.asm.MethodWriter.visitMaxs(MethodWriter.java:1475)

               at org.objectweb.asm.ClassReader.readCode(ClassReader.java:1567)

               at org.objectweb.asm.ClassReader.readMethod(ClassReader.java:1017)

               at org.objectweb.asm.ClassReader.accept(ClassReader.java:693)

               at org.objectweb.asm.ClassReader.accept(ClassReader.java:506)

               at org.objectweb.asm.ClassWriter.toByteArray(ClassWriter.java:995)

               at org.jacoco.core.instr.Instrumenter.instrument(Instrumenter.java:85)

               at org.jacoco.core.instr.Instrumenter.instrument(Instrumenter.java:108)

               ... 25 more

[ERROR]

[ERROR]

[ERROR] For more information about the errors and possible solutions, please read the following articles:

[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException



The same is working fine for other maven projects. It is failing only in this case. Also, it looks stack trace is pointing to " org.jacoco.core.instr.Instrumenter.instrument(Instrumenter.java:108)" . What may be the root cause of this ??

-Thanks,
Kesav.

Marc R. Hoffmann

unread,
Nov 15, 2016, 3:26:30 AM11/15/16
to jac...@googlegroups.com
Hi,

this is a known issue that can happen for very large methods: https://github.com/jacoco/jacoco/pull/177

The only work around for now is to exclude the problematic class ("ConfigDAO").

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/ed99f704-9df6-4854-a005-754af87b32b3%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

yajvane

unread,
Nov 15, 2016, 4:52:25 AM11/15/16
to JaCoCo and EclEmma Users

It looks I can NOT list set of classes to be ignored in command line. correct ? It looks there is no User Property defined for excludes/includes similar to skip (jacoco.skip). Believe need to change pom.xml to define classes to be ignored. rt?

-Best Regards,
Kesav.

Evgeny Mandrikov

unread,
Nov 15, 2016, 11:15:52 AM11/15/16
to JaCoCo and EclEmma Users

yajvane

unread,
Nov 16, 2016, 3:57:31 AM11/16/16
to JaCoCo and EclEmma Users
Also, it looks this issue (https://github.com/jacoco/jacoco/pull/177) is going to be fixed in 0.7.8. correct ? When is 0.7.8 jacoco going to be released ?? Also, can you point me to documentation for applying this fix as patch to 0.7.7 jacoco???

Evgeny Mandrikov

unread,
Nov 16, 2016, 7:09:15 AM11/16/16
to JaCoCo and EclEmma Users


On Wednesday, November 16, 2016 at 9:57:31 AM UTC+1, yajvane wrote:
Also, it looks this issue (https://github.com/jacoco/jacoco/pull/177) is going to be fixed in 0.7.8. correct ? When is 0.7.8 jacoco going to be released ??

No, this issue is NOT going to be fixed in 0.7.8. Read the comments on this issue carefully : it depends on fix in ASM library and we have no idea when ASM will be released.
 
Also, can you point me to documentation for applying this fix as patch to 0.7.7 jacoco???

You need to build ASM from their SVN trunk and update JaCoCo to use your build of ASM.
I wouldn't recommend to do this, because custom build - is a custom build, you'll be on your own in terms of support in case of troubles.

Instead - use official JaCoCo release to be safe and simply exclude problematic class as Marc said.

P.S. number of question marks doesn't increase importance/priority of your email over others in queues of participants of this mailing list ;)

Regards,
Evgeny

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