Build errors: Class already instrumented

7,496 views
Skip to first unread message

Fernando Pinheiro

unread,
Nov 21, 2012, 7:52:16 AM11/21/12
to jenkins-jacoco-pl...@googlegroups.com
We have moved our projects from Java 6 to Java 7 and Emma didn't work, so we are trying JaCoCo.

Our builds in command-line do build ok, but when running inside Jenkins we are getting errors that the classes are already instrumented:

Executing Maven: -B -f /dadosST/home/cruise/.hudson/jobs/wmix-sqlwrapper/workspace/wmix-sqlwrapper/pom.xml clean package deploy
[INFO] Scanning for projects...
[INFO] ------------------------------------------------------------------------
[INFO] Building sqlwrapper
[INFO] task-segment: [clean, package, deploy]
[INFO] ------------------------------------------------------------------------
[INFO] [clean:clean {execution: default-clean}] [INFO] Deleting directory /dadosST/home/cruise/.hudson/jobs/wmix-sqlwrapper/workspace/wmix-sqlwrapper/target
[INFO] [jacoco:prepare-agent {execution: default}] [INFO] argLine set to -javaagent:/dadosST/home/cruise/.m2/repository/org/jacoco/org.jacoco.agent/0.6.0.201210061924/org.jacoco.agent-0.6.0.201210061924-runtime.jar=destfile=/dadosST/home/cruise/.hudson/jobs/wmix-sqlwrapper/workspace/wmix-sqlwrapper/target/jacoco.exec,includes=br.com.wmixvideo.*
[INFO] [resources:resources {execution: default-resources}] [INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory /dadosST/home/cruise/.hudson/jobs/wmix-sqlwrapper/workspace/wmix-sqlwrapper/src/main/resources
[INFO] [compiler:compile {execution: default-compile}] [INFO] Compiling 2 source files to /dadosST/home/cruise/.hudson/jobs/wmix-sqlwrapper/workspace/wmix-sqlwrapper/target/classes
[INFO] [resources:testResources {execution: default-testResources}] [INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory /dadosST/home/cruise/.hudson/jobs/wmix-sqlwrapper/workspace/wmix-sqlwrapper/src/test/resources
[INFO] [compiler:testCompile {execution: default-testCompile}] [INFO] Compiling 1 source file to /dadosST/home/cruise/.hudson/jobs/wmix-sqlwrapper/workspace/wmix-sqlwrapper/target/test-classes
[INFO] [surefire:test {execution: default-test}] [INFO] Surefire report directory: /dadosST/home/cruise/.hudson/jobs/wmix-sqlwrapper/workspace/wmix-sqlwrapper/target/surefire-reports
-------------------------------------------------------
T E S T S
-------------------------------------------------------
Running br.com.wmixvideo.SQLWrapperTest
Tests run: 9, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.046 sec Results : Tests run: 9, Failures: 0, Errors: 0, Skipped: 0 [JENKINS] Gravando resultados de teste# Deploying the attached artifact {0}
[INFO] [jacoco:report {execution: report}] [INFO] [jar:jar {execution: default-jar}] [INFO] Building jar: /dadosST/home/cruise/.hudson/jobs/wmix-sqlwrapper/workspace/wmix-sqlwrapper/target/wmix-sqlwrapper-0.0.3-SNAPSHOT.jar
[INFO] [jacoco:prepare-agent {execution: default}] [INFO] argLine set to -javaagent:/dadosST/home/cruise/.m2/repository/org/jacoco/org.jacoco.agent/0.6.0.201210061924/org.jacoco.agent-0.6.0.201210061924-runtime.jar=destfile=/dadosST/home/cruise/.hudson/jobs/wmix-sqlwrapper/workspace/wmix-sqlwrapper/target/jacoco.exec,includes=br.com.wmixvideo.* -javaagent:/dadosST/home/cruise/.m2/repository/org/jacoco/org.jacoco.agent/0.6.0.201210061924/org.jacoco.agent-0.6.0.201210061924-runtime.jar=destfile=/dadosST/home/cruise/.hudson/jobs/wmix-sqlwrapper/workspace/wmix-sqlwrapper/target/jacoco.exec,includes=br.com.wmixvideo.*
[INFO] [resources:resources {execution: default-resources}] [INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory /dadosST/home/cruise/.hudson/jobs/wmix-sqlwrapper/workspace/wmix-sqlwrapper/src/main/resources
[INFO] [compiler:compile {execution: default-compile}] [INFO] Nothing to compile - all classes are up to date
[INFO] [resources:testResources {execution: default-testResources}] [INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory /dadosST/home/cruise/.hudson/jobs/wmix-sqlwrapper/workspace/wmix-sqlwrapper/src/test/resources
[INFO] [compiler:testCompile {execution: default-testCompile}] [INFO] Nothing to compile - all classes are up to date
[INFO] [surefire:test {execution: default-test}] [INFO] Surefire report directory: /dadosST/home/cruise/.hudson/jobs/wmix-sqlwrapper/workspace/wmix-sqlwrapper/target/surefire-reports
java.lang.instrument.IllegalClassFormatException: Error while instrumenting class br/com/wmixvideo/SQLWrapperTest.
at org.jacoco.agent.rt_kqcpih.CoverageTransformer.transform(CoverageTransformer.java:91)
at sun.instrument.TransformerManager.transform(TransformerManager.java:188)
at sun.instrument.InstrumentationImpl.transform(InstrumentationImpl.java:424)
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:791)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:449)
at java.net.URLClassLoader.access$100(URLClassLoader.java:71)
at java.net.URLClassLoader$1.run(URLClassLoader.java:361)
at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
at java.lang.ClassLoader.loadClass(ClassLoader.java:423)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
at java.lang.ClassLoader.loadClass(ClassLoader.java:356)
at org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.locateTestSets(AbstractDirectoryTestSuite.java:87)
at org.apache.maven.surefire.Surefire.createSuiteFromDefinition(Surefire.java:209)
at org.apache.maven.surefire.Surefire.run(Surefire.java:156)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:601)
at org.apache.maven.surefire.booter.SurefireBooter.runSuitesInProcess(SurefireBooter.java:345)
at org.apache.maven.surefire.booter.SurefireBooter.main(SurefireBooter.java:1009)
Caused by: java.lang.IllegalStateException: Class br/com/wmixvideo/SQLWrapperTest is already instrumented.
at org.jacoco.agent.rt_kqcpih.core.internal.instr.ClassInstrumenter.assertNotInstrumented(ClassInstrumenter.java:133)
at org.jacoco.agent.rt_kqcpih.core.internal.instr.ClassInstrumenter.visitField(ClassInstrumenter.java:81)
at org.jacoco.agent.rt_kqcpih.asm.ClassVisitor.visitField(Unknown Source)
at org.jacoco.agent.rt_kqcpih.asm.ClassReader.accept(Unknown Source)
at org.jacoco.agent.rt_kqcpih.asm.ClassReader.accept(Unknown Source)
at org.jacoco.agent.rt_kqcpih.core.instr.Instrumenter.instrument(Instrumenter.java:69)
at org.jacoco.agent.rt_kqcpih.core.instr.Instrumenter.instrument(Instrumenter.java:82)
at org.jacoco.agent.rt_kqcpih.CoverageTransformer.transform(CoverageTransformer.java:89)
... 23 more -------------------------------------------------------
T E S T S
-------------------------------------------------------
Running br.com.wmixvideo.SQLWrapperTest
java.lang.instrument.IllegalClassFormatException: Error while instrumenting class br/com/wmixvideo/SQLWrapper.
at org.jacoco.agent.rt_kqcpih.CoverageTransformer.transform(CoverageTransformer.java:91)
at sun.instrument.TransformerManager.transform(TransformerManager.java:188)
at sun.instrument.InstrumentationImpl.transform(InstrumentationImpl.java:424)
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:791)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:449)
at java.net.URLClassLoader.access$100(URLClassLoader.java:71)
at java.net.URLClassLoader$1.run(URLClassLoader.java:361)
at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
at java.lang.ClassLoader.loadClass(ClassLoader.java:423)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
at java.lang.ClassLoader.loadClass(ClassLoader.java:356)
at br.com.wmixvideo.SQLWrapperTest.wrapDate(SQLWrapperTest.java:32)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:601)
at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:45)
at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)
at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:42)
at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:20)
at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:263)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:68)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:47)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:231)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:60)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:229)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:50)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:222)
at org.junit.runners.ParentRunner.run(ParentRunner.java:300)
at org.apache.maven.surefire.junit4.JUnit4TestSet.execute(JUnit4TestSet.java:62)
at org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.executeTestSet(AbstractDirectoryTestSuite.java:140)
at org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.execute(AbstractDirectoryTestSuite.java:127)
at org.apache.maven.surefire.Surefire.run(Surefire.java:177)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:601)
at org.apache.maven.surefire.booter.SurefireBooter.runSuitesInProcess(SurefireBooter.java:345)
at org.apache.maven.surefire.booter.SurefireBooter.main(SurefireBooter.java:1009)
Caused by: java.lang.IllegalStateException: Class br/com/wmixvideo/SQLWrapper is already instrumented.
at org.jacoco.agent.rt_kqcpih.core.internal.instr.ClassInstrumenter.assertNotInstrumented(ClassInstrumenter.java:133)
at org.jacoco.agent.rt_kqcpih.core.internal.instr.ClassInstrumenter.visitField(ClassInstrumenter.java:81)
at org.jacoco.agent.rt_kqcpih.asm.ClassVisitor.visitField(Unknown Source)
at org.jacoco.agent.rt_kqcpih.asm.ClassReader.accept(Unknown Source)
at org.jacoco.agent.rt_kqcpih.asm.ClassReader.accept(Unknown Source)
at org.jacoco.agent.rt_kqcpih.core.instr.Instrumenter.instrument(Instrumenter.java:69)
at org.jacoco.agent.rt_kqcpih.core.instr.Instrumenter.instrument(Instrumenter.java:82)
at org.jacoco.agent.rt_kqcpih.CoverageTransformer.transform(CoverageTransformer.java:89)
... 42 more
java.lang.instrument.IllegalClassFormatException: Error while instrumenting class br/com/wmixvideo/comparadores/ComparadorTamanhoString.
at org.jacoco.agent.rt_kqcpih.CoverageTransformer.transform(CoverageTransformer.java:91)
at sun.instrument.TransformerManager.transform(TransformerManager.java:188)
at sun.instrument.InstrumentationImpl.transform(InstrumentationImpl.java:424)
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:791)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:449)
at java.net.URLClassLoader.access$100(URLClassLoader.java:71)
at java.net.URLClassLoader$1.run(URLClassLoader.java:361)
at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
at java.lang.ClassLoader.loadClass(ClassLoader.java:423)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
at java.lang.ClassLoader.loadClass(ClassLoader.java:356)
at br.com.wmixvideo.SQLWrapper.wrap(SQLWrapper.java:61)
at br.com.wmixvideo.SQLWrapperTest.wrapDate(SQLWrapperTest.java:32)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:601)
at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:45)
at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)
at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:42)
at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:20)
at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:263)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:68)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:47)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:231)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:60)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:229)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:50)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:222)
at org.junit.runners.ParentRunner.run(ParentRunner.java:300)
at org.apache.maven.surefire.junit4.JUnit4TestSet.execute(JUnit4TestSet.java:62)
at org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.executeTestSet(AbstractDirectoryTestSuite.java:140)
at org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.execute(AbstractDirectoryTestSuite.java:127)
at org.apache.maven.surefire.Surefire.run(Surefire.java:177)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:601)
at org.apache.maven.surefire.booter.SurefireBooter.runSuitesInProcess(SurefireBooter.java:345)
at org.apache.maven.surefire.booter.SurefireBooter.main(SurefireBooter.java:1009)
Caused by: java.lang.IllegalStateException: Class br/com/wmixvideo/comparadores/ComparadorTamanhoString is already instrumented.
at org.jacoco.agent.rt_kqcpih.core.internal.instr.ClassInstrumenter.assertNotInstrumented(ClassInstrumenter.java:133)
at org.jacoco.agent.rt_kqcpih.core.internal.instr.ClassInstrumenter.visitField(ClassInstrumenter.java:81)
at org.jacoco.agent.rt_kqcpih.asm.ClassVisitor.visitField(Unknown Source)
at org.jacoco.agent.rt_kqcpih.asm.ClassReader.accept(Unknown Source)
at org.jacoco.agent.rt_kqcpih.asm.ClassReader.accept(Unknown Source)
at org.jacoco.agent.rt_kqcpih.core.instr.Instrumenter.instrument(Instrumenter.java:69)
at org.jacoco.agent.rt_kqcpih.core.instr.Instrumenter.instrument(Instrumenter.java:82)
at org.jacoco.agent.rt_kqcpih.CoverageTransformer.transform(CoverageTransformer.java:89)
... 43 more
Tests run: 9, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.05 sec Results : Tests run: 9, Failures: 0, Errors: 0, Skipped: 0 [JENKINS] Gravando resultados de teste# Deploying the attached artifact {0}
[INFO] [jacoco:report {execution: report}]

We have uninstalled the Emma plugin and also disabled findbugs, pmd and static analysis collector plugin ones that may be also instrumenting, but the error persists.

Our pom.xml has:

<plugin>
  <groupId>org.jacoco</groupId>
  <artifactId>jacoco-maven-plugin</artifactId>
  <version>0.6.0.201210061924</version>
  <executions>
    <execution>
      <goals>
        <goal>prepare-agent</goal>
      </goals>
      <configuration>
        <includes>
          <include>br.com.wmixvideo.*</include>
        </includes>
      </configuration>
    </execution>
    <execution>
      <id>report</id>
      <phase>prepare-package</phase>
      <goals>
        <goal>report</goal>
      </goals>
      <configuration>
        <includes>
          <include>br.com.wmixvideo.*</include>
        </includes>
      </configuration>
    </execution>
  </executions>
</plugin>

We added the includes tag because we were getting this error through a huge list of classes (like org/apache/maven/surefire/booter/SurefireBooter).

Any clue?

Marc Hoffmann

unread,
Nov 21, 2012, 11:49:03 AM11/21/12
to jenkins-jacoco-pl...@googlegroups.com
Hi,

as you can see from the log you have configured two JaCoCo agents:

[INFO] argLine set to
-javaagent:/dadosST/home/cruise/.m2/repository/org/jacoco/org.jacoco.agent/0.6.0.201210061924/org.jacoco.agent-0.6.0.201210061924-runtime.jar=destfile=/dadosST/home/cruise/.hudson/jobs/wmix-sqlwrapper/workspace/wmix-sqlwrapper/target/jacoco.exec,includes=br.com.wmixvideo.*
-javaagent:/dadosST/home/cruise/.m2/repository/org/jacoco/org.jacoco.agent/0.6.0.201210061924/org.jacoco.agent-0.6.0.201210061924-runtime.jar=destfile=/dadosST/home/cruise/.hudson/jobs/wmix-sqlwrapper/workspace/wmix-sqlwrapper/target/jacoco.exec,includes=br.com.wmixvideo.*

The second one obviously complains. Make sure you configure the agent
only once.

Best regards,
-marc


On 2012-11-21 13:52, Fernando Pinheiro wrote:
> We have moved our projects from Java 6 to Java 7 and Emma didn't
> work,
> so we are trying JaCoCo.
>
> Our builds in command-line do build ok, but when running inside
> Jenkins we are getting errors that the classes are already
> instrumented:
>
>> Executing Maven: -B -f
>>
>
> /dadosST/home/cruise/.hudson/jobs/wmix-sqlwrapper/workspace/wmix-sqlwrapper/pom.xml
>> clean package deploy
>> [INFO] Scanning for projects...
>> [INFO]
>>
>
> ------------------------------------------------------------------------
>> [INFO] Building sqlwrapper
>> [INFO] task-segment: [clean, package, deploy]
>> [INFO]
>>
>
> ------------------------------------------------------------------------
>> [INFO] [CLEAN:CLEAN {EXECUTION: DEFAULT-CLEAN}] [INFO] Deleting
>> directory
>>
>
> /dadosST/home/cruise/.hudson/jobs/wmix-sqlwrapper/workspace/wmix-sqlwrapper/target
>> [INFO] [JACOCO:PREPARE-AGENT {EXECUTION: DEFAULT}] [INFO] argLine
>> set to
>>
>
> -javaagent:/dadosST/home/cruise/.m2/repository/org/jacoco/org.jacoco.agent/0.6.0.201210061924/org.jacoco.agent-0.6.0.201210061924-runtime.jar=destfile=/dadosST/home/cruise/.hudson/jobs/wmix-sqlwrapper/workspace/wmix-sqlwrapper/target/jacoco.exec,includes=br.com.wmixvideo.*
>> [INFO] [RESOURCES:RESOURCES {EXECUTION: DEFAULT-RESOURCES}] [INFO]
>> Using 'UTF-8' encoding to copy filtered resources.
>> [INFO] skip non existing resourceDirectory
>>
>
> /dadosST/home/cruise/.hudson/jobs/wmix-sqlwrapper/workspace/wmix-sqlwrapper/src/main/resources
>> [INFO] [COMPILER:COMPILE {EXECUTION: DEFAULT-COMPILE}] [INFO]
>> Compiling 2 source files to
>>
>
> /dadosST/home/cruise/.hudson/jobs/wmix-sqlwrapper/workspace/wmix-sqlwrapper/target/classes
>> [INFO] [RESOURCES:TESTRESOURCES {EXECUTION: DEFAULT-TESTRESOURCES}]
>> [INFO] Using 'UTF-8' encoding to copy filtered resources.
>> [INFO] skip non existing resourceDirectory
>>
>
> /dadosST/home/cruise/.hudson/jobs/wmix-sqlwrapper/workspace/wmix-sqlwrapper/src/test/resources
>> [INFO] [COMPILER:TESTCOMPILE {EXECUTION: DEFAULT-TESTCOMPILE}]
>> [INFO] Compiling 1 source file to
>>
>
> /dadosST/home/cruise/.hudson/jobs/wmix-sqlwrapper/workspace/wmix-sqlwrapper/target/test-classes
>> [INFO] [SUREFIRE:TEST {EXECUTION: DEFAULT-TEST}] [INFO] Surefire
>> report directory:
>>
>
> /dadosST/home/cruise/.hudson/jobs/wmix-sqlwrapper/workspace/wmix-sqlwrapper/target/surefire-reports
>> -------------------------------------------------------
>> T E S T S
>> -------------------------------------------------------
>> Running br.com.wmixvideo.SQLWrapperTest
>> Tests run: 9, Failures: 0, Errors: 0, Skipped: 0, Time elapsed:
>> 0.046 sec Results : Tests run: 9, Failures: 0, Errors: 0, Skipped: 0
>> [JENKINS] Gravando resultados de teste# Deploying the attached
>> artifact {0}
>> [INFO] [JACOCO:REPORT {EXECUTION: REPORT}] [INFO] [JAR:JAR
>> {EXECUTION: DEFAULT-JAR}] [INFO] Building jar:
>>
>
> /dadosST/home/cruise/.hudson/jobs/wmix-sqlwrapper/workspace/wmix-sqlwrapper/target/wmix-sqlwrapper-0.0.3-SNAPSHOT.jar
>> [INFO] [JACOCO:PREPARE-AGENT {EXECUTION: DEFAULT}] [INFO] argLine
>> set to
>>
>
> -javaagent:/dadosST/home/cruise/.m2/repository/org/jacoco/org.jacoco.agent/0.6.0.201210061924/org.jacoco.agent-0.6.0.201210061924-runtime.jar=destfile=/dadosST/home/cruise/.hudson/jobs/wmix-sqlwrapper/workspace/wmix-sqlwrapper/target/jacoco.exec,includes=br.com.wmixvideo.*
>>
>
> -javaagent:/dadosST/home/cruise/.m2/repository/org/jacoco/org.jacoco.agent/0.6.0.201210061924/org.jacoco.agent-0.6.0.201210061924-runtime.jar=destfile=/dadosST/home/cruise/.hudson/jobs/wmix-sqlwrapper/workspace/wmix-sqlwrapper/target/jacoco.exec,includes=br.com.wmixvideo.*
>> [INFO] [RESOURCES:RESOURCES {EXECUTION: DEFAULT-RESOURCES}] [INFO]
>> Using 'UTF-8' encoding to copy filtered resources.
>> [INFO] skip non existing resourceDirectory
>>
>
> /dadosST/home/cruise/.hudson/jobs/wmix-sqlwrapper/workspace/wmix-sqlwrapper/src/main/resources
>> [INFO] [COMPILER:COMPILE {EXECUTION: DEFAULT-COMPILE}] [INFO]
>> Nothing to compile - all classes are up to date
>> [INFO] [RESOURCES:TESTRESOURCES {EXECUTION: DEFAULT-TESTRESOURCES}]
>> [INFO] Using 'UTF-8' encoding to copy filtered resources.
>> [INFO] skip non existing resourceDirectory
>>
>
> /dadosST/home/cruise/.hudson/jobs/wmix-sqlwrapper/workspace/wmix-sqlwrapper/src/test/resources
>> [INFO] [COMPILER:TESTCOMPILE {EXECUTION: DEFAULT-TESTCOMPILE}]
>> [INFO] Nothing to compile - all classes are up to date
>> [INFO] [SUREFIRE:TEST {EXECUTION: DEFAULT-TEST}] [INFO] Surefire
>> [INFO] [JACOCO:REPORT {EXECUTION: REPORT}]
> --
> Azért kapta ezt az üzenetet, mert feliratkozott a Google Csoportok
> szolgáltatásbeli Jenkins JaCoCo plugin mailing list csoportra.
> Ha üzenetet szeretne küldeni ebbe a csoportba, küldjön egy
> e-mailt a(z) jenkins-jacoco-pl...@googlegroups.com
> címre.

Fernando Pinheiro

unread,
Nov 21, 2012, 1:23:22 PM11/21/12
to jenkins-jacoco-pl...@googlegroups.com
Hi Marc,

Thanks for your reply! As you could see, I wasn't configuring two agents in POM or whenever but, as this is a jar for other projects, running the goals "clean package deploy" did ran the same phases (package & deploy).
The incorrect configuration in jenkins was, in this case, the package goal, as this is not needed.

Really thanks. Now we are another JaCoCo user.

Best Regards,
Fernando

Gopi Kumar

unread,
May 21, 2013, 4:12:34 PM5/21/13
to jenkins-jacoco-pl...@googlegroups.com
Hi,

Even I got the same error and in my jenkins configuration I'm running the goals 'clean install'. 

[INFO] --- maven-surefire-plugin:2.13:test (default-test) @ parser ---
[INFO] Surefire report directory: /home/user/parser/target/surefire-reports
-------------------------------------------------------
  
T E S T S
-------------------------------------------------------
Running TestSuite
Configuring TestNG with: TestNG652Configurator
java.lang.instrument.IllegalClassFormatException: Error while instrumenting class org/testng/internal/Parameters.
    at org.jacoco.agent.rt_6l8m50.CoverageTransformer.transform(CoverageTransformer.java:91)
    at sun.instrument.TransformerManager.transform(TransformerManager.java:188)
    -----
    -----
Caused by: java.lang.IllegalStateException: Class org/testng/internal/Parameters is already instrumented.
    at org.jacoco.agent.rt_6l8m50.core.internal.instr.ClassInstrumenter.assertNotInstrumented(ClassInstrumenter.java:138)
    at org.jacoco.agent.rt_6l8m50.core.internal.instr.ClassInstrumenter.visitField(ClassInstrumenter.java:81)
    -----
    -----

Also to note I've defined jacoco agent in the argline for maven-surefire-plugin  as below, 

</argLine>
-javaagent:${user.home}/.m2/repository/org/jacoco/org.jacoco.agent/0.6.1.201212231917/org.jacoco.agent-0.6.1.201212231917-runtime.jar=destfile=${basedir}/target/jacoco.exec</argLine>
 
If I don't set the jacoco agent in argline of surefire plugin configuration, then the report and check of jacoco-maven-plugin prints below error and don't produce jacoco execution file,
 
[INFO] --- jacoco-maven-plugin:0.6.1.201212231917:report (jacoco-site) @ parser ---
[INFO] Skipping JaCoCo execution due to missing execution data file
[INFO] 
[INFO] --- jacoco-maven-plugin:0.6.1.201212231917:check (check) @ parser ---
[INFO] Skipping JaCoCo execution due to missing execution data file

By defining argline I'm able to produce reports but the above errors are coming up in the build log.
Please help me to get rid of these errors/warnings.

Thanks,
Gopi.

Marc R. Hoffmann

unread,
May 22, 2013, 11:48:41 PM5/22/13
to jenkins-jacoco-pl...@googlegroups.com
Hi,

as said before specifying the agent manually will result in two agents
and is the wrong approach. So you need to find out what's wrong with
your prepare agent goal:

1) Can you please run your build with -X option and see what the
effective command line for your test execution is?

2) Can you please provide your POM, or even better a reproducer project?

2) JaCoCo download contains with a working Maven example. Maybe you
start with this and see what the differene is to yor configuration.

Cheers,
-marc



On 21.05.13 22:12, Gopi Kumar wrote:
> Hi,
>
> Even I got the same error and in my jenkins configuration I'm running
> the goals 'clean install'.
>
> [INFO]*--- maven-surefire-plugin:2.13:test (default-test) @ parser ---*
>
> *
>
> [INFO] Surefire report directory: /home/user/parser/target/surefire-reports
>
> -------------------------------------------------------
>
> *
>
> T E S T S*
>
> *
>
> -------------------------------------------------------
>
> Running TestSuite
>
> Configuring TestNG with: TestNG652Configurator**
> > Az�rt kapta ezt az �zenetet, mert feliratkozott a Google
> Csoportok
> > szolg�ltat�sbeli Jenkins JaCoCo plugin mailing list csoportra.
> > Ha �zenetet szeretne k�ldeni ebbe a csoportba, k�ldj�n egy
> > e-mailt a(z) jenkins-jacoco-pl...@googlegroups.com
> > c�mre.

Gopi Kumar

unread,
May 23, 2013, 3:41:38 PM5/23/13
to jenkins-jacoco-pl...@googlegroups.com
Hi Marc,

Thanks for your reply.

Actually in my case the only way jacoco execution file is generated through specifying agent in the maven surefire plugin.
I tried with the same way as in the JaCoCo download example, still the execution file is not getting generated. 

As requested here is my test command,

-------------------------------------------------------
 T E S T S
-------------------------------------------------------
Forking command line: /bin/sh -c cd /home/gopi/commit_testjob/vx && /home/y/libexec64/jdk1.7.0/jre/bin/java -Dfile.encoding=ANSI_X3.4-1968 -Djava.library.path=./x86_64-rhel4-gcc3:./i386-rhel4-gcc3:/home/y/lib64:/home/y/lib -javaagent:/home/gopi/.m2/repository/org/jacoco/org.jacoco.agent/0.6.2.201302030002/org.jacoco.agent-0.6.2.201302030002-runtime.jar=destfile=/home/gopi/commit_testjob/vx/target/jacoco.exec -jar /home/gopi/commit_testjob/vx/target/surefire/surefirebooter6244262558260908589.jar /home/gopi/commit_testjob/vx/target/surefire/surefire2485244306991783783tmp /home/gopi/commit_testjob/vx/target/surefire/surefire_12561095631331689567tmp
Running TestSuite
Configuring TestNG with: TestNG652Configurator
java.lang.instrument.IllegalClassFormatException: Error while instrumenting class org/testng/internal/Parameters.
----
----
-------------------------------------------------------

And you see agent is called only once in the command.

Here is the pom file with the Jacoco and sure fire plugin reference,

==============================
My POM File

<plugin>
           <groupId>org.jacoco</groupId>
           <artifactId>jacoco-maven-plugin</artifactId>
           <version>0.6.1.201212231917</version>
           <executions>
                <execution>
                        <id>jacoco-initialize</id>
                        <phase>initialize</phase>
                        <goals>
                                <goal>prepare-agent</goal>
                        </goals>
                        <configuration>
                                <destfile>${basedir}/target/jacoco.exec</destfile>
                        </configuration>
                </execution>
                <execution>
                        <id>jacoco-site</id>
                        <phase>package</phase>
                        <goals>
                                <goal>report</goal>
                        </goals>
                        <configuration>
                                <datafile>${basedir}/target/jacoco.exec</datafile>
                                <outputDirectory>${basedir}/target/jacoco</outputDirectory>
                        </configuration>
                </execution>
                <execution>
                        <id>check</id>
                                <goals>
                                        <goal>check</goal>
                                </goals>
                                <configuration>
                                <check>
                                        <classRatio>0</classRatio>
                                        <instructionRatio>0</instructionRatio>
                                        <methodRatio>100</methodRatio>
                                        <branchRatio>0</branchRatio>
                                        <complexityRatio>0</complexityRatio>
                                        <lineRatio>90</lineRatio>
                                </check>
                        </configuration>
                </execution>
             </executions>
 </plugin>
 <plugin>
           <groupId>org.apache.maven.plugins</groupId>
           <artifactId>maven-surefire-plugin</artifactId>
           <version>2.13</version>
           <configuration>
                        <properties>
                                <property>
                                        <name>listener</name>
                                        <value>mockit.integration.testng.Initializer</value>
                                </property>
                        </properties>
                        <forkMode>once</forkMode>
                        <argLine>-Dfile.encoding=ANSI_X3.4-1968
                        -Djava.library.path=./x86_64-rhel4-gcc3:./i386-rhel4-gcc3:${yroot.dir}/lib64:${yroot.dir}/lib
 -javaagent:${user.home}/.m2/repository/org/jacoco/org.jacoco.agent/0.6.1.201212231917/org.jacoco.agent-0.6.1.201212231917-runtime.jar=destfile=${basedir}/target/jacoco.exec</argLine>
<excludedGroups>notIsolate,EventListenersRegression</excludedGroups>
           </configuration>
 </plugin>

==================

Even without jacoco prepare-agent and report the jacoco execution file is generated just by providing agent in the argline of maven surefire plugin. But without that nothing is getting generated. 

Also I see that many are hitting the same problem as pointed in other forums,


If you think these are just warnings then is there a way we can hide them from printing in the log console.

Thanks
Gopi.
>          > e-mailt a(z) jenkins-jacoco-plugin-mailing-li...@googlegroups.com
>          > cďż˝mre.

Marc R. Hoffmann

unread,
May 23, 2013, 4:05:40 PM5/23/13
to jenkins-jacoco-pl...@googlegroups.com
Hi,

your POM file DOES specify the agent in the argLine:

<argLine>-Dfile.encoding=ANSI_X3.4-1968

-Djava.library.path=./x86_64-rhel4-gcc3:./i386-rhel4-gcc3:${yroot.dir}/lib64:${yroot.dir}/lib

-javaagent:${user.home}/.m2/repository/org/jacoco/org.jacoco.agent/0.6.1.201212231917/org.jacoco.agent-0.6.1.201212231917-runtime.jar=destfile=${basedir}/target/jacoco.exec</argLine>

As I tried to point out before this is the wrong way! Let the
prepare-agent goal do the job!

If you want to to customize the argLine use the following syntax:

<argLine>yourparams ${argLine}</argLine>

Notice the ${argLine} at the end: This ensures that JaCoCo settings are
not overwritten.

Best regards,
-marc
> jenkins-jacoco-pl...@googlegroups.com <javascript:>
> > > c�mre.

Gopi Kumar

unread,
May 23, 2013, 7:32:39 PM5/23/13
to jenkins-jacoco-pl...@googlegroups.com
Hi Marc,

As I mentioned before my prepare-agent is not generating the execution file and only when I add the agent into argLine of surefire plugin, execution file is getting created but with the class already instrumented errors.

I think only by not adding the agent in the argLine we can skip these erorrs, but without that jacoco.exec file is not getting created as that is what report goals says when we reach that point as "Skipping JaCoCo execution due to missing execution data file". 

Is there any other way to do debug why the prepare agent is not generating the exec file.

Here is the debug output of prepare agent without adding the agent in the argLine of sure fire plugin,

===============
INFO] --- jacoco-maven-plugin:0.6.1.201212231917:prepare-agent (jacoco-initialize) @ vx ---
[DEBUG] Configuring mojo org.jacoco:jacoco-maven-plugin:0.6.1.201212231917:prepare-agent from plugin realm ClassRealm[plugin>org.jacoco:jacoco-maven-plugin:0.6.1.201212231917, parent: sun.misc.Launcher$AppClassLoader@6f7e982f]
[DEBUG] Configuring mojo 'org.jacoco:jacoco-maven-plugin:0.6.1.201212231917:prepare-agent' with basic configurator -->
[DEBUG]   (f) destFile = /home/gopi/workspace/commit_testjob/XMAS/vx/target/jacoco.exec
[DEBUG]   (f) pluginArtifactMap = {org.jacoco:jacoco-maven-plugin=org.jacoco:jacoco-maven-plugin:maven-plugin:0.6.1.201212231917:, backport-util-concurrent:backport-util-concurrent=backport-util-concurrent:backport-util-concurrent:jar:3.1:compile, org.codehaus.plexus:plexus-interpolation=org.codehaus.plexus:plexus-interpolation:jar:1.8.1:compile, junit:junit=junit:junit:jar:4.8.2:compile, org.codehaus.plexus:plexus-utils=org.codehaus.plexus:plexus-utils:jar:1.5.6:compile, org.apache.maven.reporting:maven-reporting-api=org.apache.maven.reporting:maven-reporting-api:jar:2.1.0:compile, org.apache.maven.doxia:doxia-sink-api=org.apache.maven.doxia:doxia-sink-api:jar:1.1:compile, org.apache.maven.doxia:doxia-logging-api=org.apache.maven.doxia:doxia-logging-api:jar:1.1:compile, org.apache.maven.reporting:maven-reporting-impl=org.apache.maven.reporting:maven-reporting-impl:jar:2.1:compile, org.apache.maven.doxia:doxia-core=org.apache.maven.doxia:doxia-core:jar:1.1.2:compile, xerces:xercesImpl=xerces:xercesImpl:jar:2.8.1:compile, commons-lang:commons-lang=commons-lang:commons-lang:jar:2.4:compile, commons-httpclient:commons-httpclient=commons-httpclient:commons-httpclient:jar:3.1:compile, commons-codec:commons-codec=commons-codec:commons-codec:jar:1.2:compile, org.apache.maven.doxia:doxia-site-renderer=org.apache.maven.doxia:doxia-site-renderer:jar:1.1.2:compile, org.apache.maven.doxia:doxia-decoration-model=org.apache.maven.doxia:doxia-decoration-model:jar:1.1.2:compile, org.apache.maven.doxia:doxia-module-xhtml=org.apache.maven.doxia:doxia-module-xhtml:jar:1.1.2:compile, org.apache.maven.doxia:doxia-module-fml=org.apache.maven.doxia:doxia-module-fml:jar:1.1.2:compile, org.codehaus.plexus:plexus-i18n=org.codehaus.plexus:plexus-i18n:jar:1.0-beta-7:compile, org.codehaus.plexus:plexus-velocity=org.codehaus.plexus:plexus-velocity:jar:1.1.7:compile, org.apache.velocity:velocity=org.apache.velocity:velocity:jar:1.5:compile, commons-collections:commons-collections=commons-collections:commons-collections:jar:3.2:compile, commons-validator:commons-validator=commons-validator:commons-validator:jar:1.2.0:compile, commons-beanutils:commons-beanutils=commons-beanutils:commons-beanutils:jar:1.7.0:compile, commons-digester:commons-digester=commons-digester:commons-digester:jar:1.6:compile, commons-logging:commons-logging=commons-logging:commons-logging:jar:1.0.4:compile, oro:oro=oro:oro:jar:2.0.8:compile, xml-apis:xml-apis=xml-apis:xml-apis:jar:1.0.b2:compile, org.jacoco:org.jacoco.agent=org.jacoco:org.jacoco.agent:jar:runtime:0.6.1.201212231917:compile, org.jacoco:org.jacoco.core=org.jacoco:org.jacoco.core:jar:0.6.1.201212231917:compile, org.ow2.asm:asm-all=org.ow2.asm:asm-all:jar:4.1:compile, org.jacoco:org.jacoco.report=org.jacoco:org.jacoco.report:jar:0.6.1.201212231917:compile}
[DEBUG]   (f) project = MavenProject: package.vx:vx:1.1-SNAPSHOT @ /home/gopi/workspace/commit_testjob/XMAS/vx/pom.xml
[DEBUG]   (f) skip = false
[DEBUG] -- end configuration --
[INFO] argLine set to -javaagent:/home/gopi/.m2/repository/org/jacoco/org.jacoco.agent/0.6.1.201212231917/org.jacoco.agent-0.6.1.201212231917-runtime.jar=destfile=/home/gopi/workspace/commit_testjob/XMAS/vx/target/jacoco.exec

===============

Thanks for your help Marc,
Gopi. 
>     jenkins-jacoco-plugin-mailing-li...@googlegroups.com <javascript:>
>      >          > cďż˝mre.

Marc R. Hoffmann

unread,
May 23, 2013, 11:49:14 PM5/23/13
to jenkins-jacoco-pl...@googlegroups.com
> I mentioned before my prepare-agent is not generating the execution

I know. Than's why I try to help you get it work.

> Is there any other way to do debug why the prepare agent is not
> generating the exec file.

There is. From your debug output we need to have a look at the line
where its sais "Forking command line:".

And Can you please provide the POM file that you use when *not* adding
the agent? Did you use the pattern "<argLine>yourparams
${argLine}</argLine>" as I suggested?
> <http://stackoverflow.com/questions/10894672/adding-jvm-args-and-jacoco-maven-plugin>
>
> >
> > https://github.com/jacoco/jacoco/issues/32#issuecomment-18338974
> > jenkins-jacoco-pl...@googlegroups.com <javascript:>
> <javascript:>

Marc R. Hoffmann

unread,
May 23, 2013, 11:51:27 PM5/23/13
to jenkins-jacoco-pl...@googlegroups.com
BTW, please stop cross-posting to unrelated closed bugs. This is not
helpful to motivate people to provide free support ;-)
> <http://stackoverflow.com/questions/10894672/adding-jvm-args-and-jacoco-maven-plugin>
>
> >
> > https://github.com/jacoco/jacoco/issues/32#issuecomment-18338974

Gopi Kumar

unread,
May 24, 2013, 2:01:35 AM5/24/13
to jenkins-jacoco-pl...@googlegroups.com
Hi Marc,

Here is the debug out showing forking command,

-------------------------------------------------------
 T E S T S
-------------------------------------------------------
Forking command line: /bin/sh -c cd /home/gopi/commit_testjob/vx && /home/y/libexec64/jdk1.7.0/jre/bin/java -Dfile.encoding=ANSI_X3.4-1968 -Djava.library.path=./x86_64-rhel4-gcc3:./i386-rhel4-gcc3:/home/y/lib64:/home/y/lib -javaagent:/home/gopi/.m2/repository/org/jacoco/org.jacoco.agent/0.6.2.201302030002/org.jacoco.agent-0.6.2.201302030002-runtime.jar=destfile=/home/gopi/commit_testjob/vx/target/jacoco.exec -jar /home/gopi/commit_testjob/vx/target/surefire/surefirebooter6244262558260908589.jar /home/gopi/commit_testjob/vx/target/surefire/surefire2485244306991783783tmp /home/gopi/commit_testjob/vx/target/surefire/surefire_12561095631331689567tmp
Running TestSuite
Configuring TestNG with: TestNG652Configurator
java.lang.instrument.IllegalClassFormatException: Error while instrumenting class org/testng/internal/Parameters.
----
----
-------------------------------------------------------

Yes I used the pattern as you recommended ${argLine} and only when I use that or the complete path as I mentioned before, execution file is getting generated with the instrumentation errors and if I don't use it execution file is not getting generated. 

I'll share the pom file soon.

Thanks,
Gopi.
>      > jenkins-jacoco-plugin-mailing-li...@googlegroups.com <javascript:>
>     <javascript:>

Marc Hoffmann

unread,
May 24, 2013, 2:24:46 AM5/24/13
to jenkins-jacoco-pl...@googlegroups.com
> Yes I used the pattern as you recommended ${argLine}

Ok, this is the only way we test your setup for now. Please stay with
this configuration for the next steps, ok?

So from the debug output "Forking command line..." we see that there is
only one JaCoCo agent -- which looks ok.

1) Can you please check whether the file file at
/home/gopi/commit_testjob/vx/target/jacoco.exec exists after the test?

2) What is the IllegalClassFormatException in your log? Can you please
provide the full stack trace?
>> [1]
>>>
>>
>
> <http://stackoverflow.com/questions/10894672/adding-jvm-args-and-jacoco-maven-plugin
>> [2]>
>>>
>>> >
>>> > https://github.com/jacoco/jacoco/issues/32#issuecomment-18338974
>> [3]
>>> <https://github.com/jacoco/jacoco/issues/32#issuecomment-18338974
>> [4]>
>>> > jenkins-jacoco-pl...@googlegroups.com
>> <javascript:>
>>> <javascript:>
>
> --
> Azért kapta ezt az üzenetet, mert feliratkozott a Google Csoportok
> szolgáltatásbeli Jenkins JaCoCo plugin mailing list csoportra.
> Az erről a csoportról és az ahhoz kapcsolódó e-mailekről való
> leiratkozáshoz küldjön egy levelet a következő címre:
> jenkins-jacoco-plugin-m...@googlegroups.com.
> Ha üzenetet szeretne küldeni ebbe a csoportba, küldjön egy
> e-mailt a(z) jenkins-jacoco-pl...@googlegroups.com
> címre.
> További lehetőségekért látogasson el a(z)
> https://groups.google.com/groups/opt_out [5] címre.
>
>
>
> Links:
> ------
> [1]
>
> http://stackoverflow.com/questions/10894672/adding-jvm-args-and-jacoco-maven-plugin
> [2]
>
> http://stackoverflow.com/questions/10894672/adding-jvm-args-and-jacoco-maven-plugin
> [3] https://github.com/jacoco/jacoco/issues/32#issuecomment-18338974
> [4] https://github.com/jacoco/jacoco/issues/32#issuecomment-18338974
> [5] https://groups.google.com/groups/opt_out

Gopi Kumar

unread,
May 24, 2013, 1:41:53 PM5/24/13
to jenkins-jacoco-pl...@googlegroups.com
Yes, the file /home/gopi/commit_testjob/vx/target/jacoco.exec exists after the test and even checks are performed on it successfully when I add ${argLine} to surefire-plugin. In one case even my job failed when the coverage percentage was not met to the level what I set in the check goal. 

[INFO] --- jacoco-maven-plugin:0.6.1.201212231917:check (check) @ vx ---
[INFO] All coverage checks have been met.

So functionality wise I think I there are no issues, except for this exceptions in the log.

As requested here is the complete error log for IllegalClassFormatException,

================================================

java.lang.instrument.IllegalClassFormatException: Error while instrumenting class org/testng/internal/Parameters.
at org.jacoco.agent.rt_6l8m50.CoverageTransformer.transform(CoverageTransformer.java:91)
at sun.instrument.TransformerManager.transform(TransformerManager.java:188)
at sun.instrument.InstrumentationImpl.transform(InstrumentationImpl.java:424)
at sun.instrument.InstrumentationImpl.redefineClasses0(Native Method)
at sun.instrument.InstrumentationImpl.redefineClasses(InstrumentationImpl.java:170)
at mockit.internal.startup.Startup.redefineMethods(Startup.java:184)
at mockit.internal.startup.Startup.redefineMethods(Startup.java:176)
at mockit.internal.annotations.MockClassSetup.applyClassModifications(MockClassSetup.java:190)
at mockit.internal.annotations.MockClassSetup.redefineMethodsInClassHierarchy(MockClassSetup.java:151)
at mockit.internal.annotations.MockClassSetup.redefineMethods(MockClassSetup.java:140)
at mockit.Mockit.setUpMocks(Mockit.java:249)
at mockit.integration.testng.internal.TestNGRunnerDecorator.<init>(TestNGRunnerDecorator.java:67)
at mockit.integration.testng.internal.TestNGRunnerDecorator.registerWithTestNG(TestNGRunnerDecorator.java:60)
at mockit.integration.testng.Initializer.<init>(Initializer.java:29)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:525)
at java.lang.Class.newInstance0(Class.java:374)
at java.lang.Class.newInstance(Class.java:327)
at org.testng.internal.ClassHelper.newInstance(ClassHelper.java:49)
at org.testng.TestNG.setListenerClasses(TestNG.java:686)
at org.testng.TestNG.configure(TestNG.java:1429)
at org.testng.TestNG.configure(TestNG.java:1594)
at org.apache.maven.surefire.testng.conf.TestNGMapConfigurator.configure(TestNGMapConfigurator.java:52)
at org.apache.maven.surefire.testng.TestNGExecutor.run(TestNGExecutor.java:74)
at org.apache.maven.surefire.testng.TestNGDirectoryTestSuite.executeMulti(TestNGDirectoryTestSuite.java:189)
at org.apache.maven.surefire.testng.TestNGDirectoryTestSuite.execute(TestNGDirectoryTestSuite.java:105)
at org.apache.maven.surefire.testng.TestNGProvider.invoke(TestNGProvider.java:117)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:601)
at org.apache.maven.surefire.util.ReflectionUtils.invokeMethodWithArray2(ReflectionUtils.java:208)
at org.apache.maven.surefire.booter.ProviderFactory$ProviderProxy.invoke(ProviderFactory.java:158)
at org.apache.maven.surefire.booter.ProviderFactory.invokeProvider(ProviderFactory.java:86)
at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:153)
at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:95)
Caused by: java.lang.IllegalStateException: Class org/testng/internal/Parameters is already instrumented.
at org.jacoco.agent.rt_6l8m50.core.internal.instr.ClassInstrumenter.assertNotInstrumented(ClassInstrumenter.java:138)
at org.jacoco.agent.rt_6l8m50.core.internal.instr.ClassInstrumenter.visitField(ClassInstrumenter.java:81)
at org.jacoco.agent.rt_6l8m50.asm.ClassVisitor.visitField(Unknown Source)
at org.jacoco.agent.rt_6l8m50.asm.ClassReader.a(Unknown Source)
at org.jacoco.agent.rt_6l8m50.asm.ClassReader.accept(Unknown Source)
at org.jacoco.agent.rt_6l8m50.asm.ClassReader.accept(Unknown Source)
at org.jacoco.agent.rt_6l8m50.core.instr.Instrumenter.instrument(Instrumenter.java:69)
at org.jacoco.agent.rt_6l8m50.core.instr.Instrumenter.instrument(Instrumenter.java:82)
at org.jacoco.agent.rt_6l8m50.CoverageTransformer.transform(CoverageTransformer.java:89)
... 37 more

================================================

Also let me know if I need to check any other configuration in my pom or any conflicting plugins, for coverage as mentioned in my above comment jacoco and maven surefire plugin are the only additions/changes in my POM.

Thanks,
Gopi.
>> <javascript:>
>>> <javascript:>
>
>  --
>  Azért kapta ezt az üzenetet, mert feliratkozott a Google Csoportok
> szolgáltatásbeli Jenkins JaCoCo plugin mailing list csoportra.
>  Az erről a csoportról és az ahhoz kapcsolódó e-mailekről való
> leiratkozáshoz küldjön egy levelet a következő címre:
>  Ha üzenetet szeretne küldeni ebbe a csoportba, küldjön egy

Marc R. Hoffmann

unread,
May 25, 2013, 8:00:12 AM5/25/13
to jenkins-jacoco-pl...@googlegroups.com
> mockit.internal.startup.Startup.redefineMethods(Startup.java:176)

You're using a mocking framework which dynamically redefines class
files. It is a known limitation that JaCoCo does not work well in
compination with such tools. You might encounter exceptions and miss
execution data.

Cheers,
-marc
> >>> > jenkins-jacoco-pl...@googlegroups.com
> <javascript:>
> >> <javascript:>
> >>> <javascript:>
> >
> > --
> > Az�rt kapta ezt az �zenetet, mert feliratkozott a Google Csoportok
> > szolg�ltat�sbeli Jenkins JaCoCo plugin mailing list csoportra.
> > Az err�l a csoportr�l �s az ahhoz kapcsol�d� e-mailekr�l val�
> > leiratkoz�shoz k�ldj�n egy levelet a k�vetkez� c�mre:
> > jenkins-jacoco-plugin-m...@googlegroups.com
> <javascript:>.
> > Ha �zenetet szeretne k�ldeni ebbe a csoportba, k�ldj�n egy
> > e-mailt a(z) jenkins-jacoco-pl...@googlegroups.com
> <javascript:>
> > c�mre.
> > Tov�bbi lehet�s�gek�rt l�togasson el a(z)
> > https://groups.google.com/groups/opt_out
> <https://groups.google.com/groups/opt_out> [5] c�mre.
> <https://groups.google.com/groups/opt_out>
Message has been deleted
Message has been deleted

Gopi Kumar

unread,
May 25, 2013, 11:47:38 PM5/25/13
to jenkins-jacoco-pl...@googlegroups.com
Thanks Marc for the update, even yesterday I checked with my other project and it worked perfect.
So I was under impression that some other additional tool in this project is causing the problem and was in the process of figuring it out, meantime your reply clarified it. I checked it back and noticed that we have excluded test library jmockit in my working project. 

This means that the IllegalClassFormatEceptions thrown because of this are actual errors and not just warnings and it will affect the coverage data. I'll go ahead and see how we an handle this mix of tools. Meantime can you please let me know if there are any plans in future to fix this limitation in JaCoCo.

Thanks again,
Gopi.  
>      >>> > jenkins-jacoco-plugin-mailing-li...@googlegroups.com
>     <javascript:>
>      >> <javascript:>
>      >>> <javascript:>
>      >
>      >  --
>      >  Azďż˝rt kapta ezt az ďż˝zenetet, mert feliratkozott a Google Csoportok
>      > szolgďż˝ltatďż˝sbeli Jenkins JaCoCo plugin mailing list csoportra.
>      >  Az errďż˝l a csoportrďż˝l ďż˝s az ahhoz kapcsolďż˝dďż˝ e-mailekrďż˝l valďż˝
>      > leiratkozďż˝shoz kďż˝ldjďż˝n egy levelet a kďż˝vetkezďż˝ cďż˝mre:
>      > jenkins-jacoco-plugin-mailing-list+unsubscribe@googlegroups.com
>     <javascript:>.
>      >  Ha ďż˝zenetet szeretne kďż˝ldeni ebbe a csoportba, kďż˝ldjďż˝n egy
>      > e-mailt a(z) jenkins-jacoco-plugin-mailing-li...@googlegroups.com

Marc R. Hoffmann

unread,
May 26, 2013, 4:02:26 PM5/26/13
to jenkins-jacoco-pl...@googlegroups.com
> Meantime can you please let me know if there are any plans in future
> to fix this limitation in JaCoCo.

Sorry, no plans to analyze this due to limited resources.

-marc


On 26.05.13 05:17, Gopi Kumar wrote:
> Thanks Marc for the update, even yesterday I checked with my other
> project and it worked perfect.
> So I was under impression that some other additional plugin in this
> project is causing the problem and was in the process of figuring it
> out, meantime your reply clarified it.
>
> This means that the IllegalClassFormatEceptions thrown because of this
> are actual errors and not just warnings and it will affect the coverage
> data. I'll go ahead and see how we an handle this mix of tools. Meantime
> can you please let me know if there are any plans in future to fix this
> limitation in JaCoCo.
>
> Thanks again,
> Gopi.
>
> On Saturday, May 25, 2013 5:00:12 AM UTC-7, Marc Hoffmann wrote:
>
> > <https://groups.google.com/groups/opt_out
> <https://groups.google.com/groups/opt_out>>
>

Gopi Kumar

unread,
May 27, 2013, 5:27:30 AM5/27/13
to jenkins-jacoco-pl...@googlegroups.com
Coverage worked fine for most of my modules after I added jmockit javaagent to the maven-surefire-plugin along with jacoco verison 0.5.7.201204190339.

Keep us posted if this limitation addressed in future.

Thanks
Gopi.
>     <javascript:>
>      >     <javascript:>
>      >      >> <javascript:>
>      >      >>> <javascript:>
>      >      >
>      >      >  --
>      >      >  Azďż˝rt kapta ezt az ďż˝zenetet, mert feliratkozott a
>     Google Csoportok
>      >      > szolgďż˝ltatďż˝sbeli Jenkins JaCoCo plugin mailing list
>     csoportra.
>      >      >  Az errďż˝l a csoportrďż˝l ďż˝s az ahhoz kapcsolďż˝dďż˝
>     e-mailekrďż˝l valďż˝
>      >      > leiratkozďż˝shoz kďż˝ldjďż˝n egy levelet a kďż˝vetkezďż˝
>     cďż˝mre:
>      >      >
>     <javascript:>
>      >     <javascript:>.
>      >      >  Ha ďż˝zenetet szeretne kďż˝ldeni ebbe a csoportba,
>     kďż˝ldjďż˝n egy
>      >      > e-mailt a(z)
Reply all
Reply to author
Forward
0 new messages