#129 ClassFormatException

closed-fixed
nobody
JaCoCo (32)
5
2012-09-14
2012-06-22
chris
No

The attached class causes the exception. See http://sourceforge.net/projects/eclemma/forums/forum/614869/topic/5373053 for stack trace.

jacoco-maven-plugin version 0.5.7.201204190339, tycho 0.15.0, jdk1.6.0_33 64bit, Win7

Discussion

1 2 > >> (Page 1 of 2)
  • Marc R. Hoffmann

    Recently the JaCoCo instrumentation mechanics has been reworked due to a couple of issues. Please test your scenario with 0.5.8-SNAPSHOT. The snapshot repository is located at https://oss.sonatype.org/content/repositories/snapshots

     
  • chris

    chris - 2012-06-23

    Ok, I will do that. However, I have issues connecting to the repository. Sorry if this is a maven question (I'm relatively new to maven, tycho etc.), but how do I make maven find that version? I have added

    <profile>
    <activation>
    <activeByDefault>true</activeByDefault>
    </activation>
    <repositories>
    <repository>
    <url>https://oss.sonatype.org/content/repositories/snapshots</url>
    <releases>
    <enabled>true</enabled>
    </releases>
    <snapshots>
    <enabled>true</enabled>
    </snapshots>
    </repository>
    </repositories>
    </profile>

    to the profiles section of my maven's settings.xml (and debugging shows that maven indeed uses that settings file, although I don't see any reference to the added profile), but I still get

    [DEBUG] Could not find metadata org.jacoco:jacoco-maven-plugin:0.5.8.SNAPSHOT/maven-metadata.xml in local (C:\.m2\repository)
    [DEBUG] Could not find metadata org.jacoco:jacoco-maven-plugin:0.5.8.SNAPSHOT/maven-metadata.xml in local (C:\.m2\repository)
    [WARNING] The POM for org.jacoco:jacoco-maven-plugin:jar:0.5.8.SNAPSHOT is missing, no dependency information available
    [ERROR] Internal error: java.lang.RuntimeException: org.apache.maven.MavenExecutionException: Could not setup plugin ClassRealm: Plugin org.jacoco:jacoco-maven-plugin:0.5.8.SNAPSHOT or one of its dependencies could not be resolved: Failed to read artifact descriptor for org.jacoco:jacoco-maven-plugin:jar:0.5.8.SNAPSHOT: Could not find artifact org.jacoco:jacoco-maven-plugin:pom:0.5.8.SNAPSHOT -> [Help 1]

    Why doesn't maven consider the added repository?

     
  • chris

    chris - 2012-06-25

    Hi, I tried that (and I had studied the POM intro :-) ), but no luck... I will ask on the mailing list.

     
  • Evgeny Mandrikov

    Do you use repository manager (like Nexus) ?
    Could you provide complete build log in order to see attempt to download plugin?

     
  • Marc R. Hoffmann

    Has this issue been resolved for you?

     
  • Marc R. Hoffmann

    • status: open --> pending
     
  • Evgeny Mandrikov

    Note that now you don't need to play with repositories, because JaCoCo 0.5.8 has been released and available in Central Maven Repository.

     
  • chris

    chris - 2012-07-13
    • status: pending --> open
     
  • chris

    chris - 2012-07-13

    Sorry for not coming back to you earlier... Unfortunately, I didn't have time to play with maven some more, but I just ran my tests with 0.5.8, and many of them are failing... The cause I see in the maven log is attached below. Note that I only changed the jacoco version and removed the exclusion - everything else is exactly the same.

    Here's the jacoco config I used to run my (failing) tests:

    <plugin>
    <groupId>org.jacoco</groupId>
    <artifactId>jacoco-maven-plugin</artifactId>
    <version>0.5.8.201207111220</version>
    <executions>
    <execution>
    <goals>
    <goal>prepare-agent</goal>
    </goals>
    <configuration>
    <destFile>${sonar.jacoco.reportPath}</destFile>
    <!-- <excludes> -->
    <!-- <exclude>org.eclipse.uml2.uml.*</exclude> -->
    <!-- </excludes> -->
    </configuration>
    </execution>
    </executions>
    </plugin>

    And here's the results I see in the logs:

    Results :

    Tests in error:
    invocationFire(de.upb.dmm.transformation.dmm2groove.tests.TransformationTest): StackMapTable format error: bad verification type
    overwritingFire(de.upb.dmm.transformation.dmm2groove.tests.TransformationTest): StackMapTable format error: bad verification type
    premiseFire(de.upb.dmm.transformation.dmm2groove.tests.TransformationTest): StackMapTable format error: bad verification type
    simpleActivity_decision(de.upb.dmm.transformation.dmm2groove.tests.TransformationTest): StackMapTable format error: bad verification type
    simpleActivity_fork(de.upb.dmm.transformation.dmm2groove.tests.TransformationTest): StackMapTable format error: bad verification type
    simpleActivity_nested(de.upb.dmm.transformation.dmm2groove.tests.TransformationTest): StackMapTable format error: bad verification type
    simpleFire(de.upb.dmm.transformation.dmm2groove.tests.TransformationTest): StackMapTable format error: bad verification type
    uqsFire(de.upb.dmm.transformation.dmm2groove.tests.TransformationTest): StackMapTable format error: bad verification type
    uqsFire2(de.upb.dmm.transformation.dmm2groove.tests.TransformationTest): StackMapTable format error: bad verification type
    uqsInvocation(de.upb.dmm.transformation.dmm2groove.tests.TransformationTest): StackMapTable format error: bad verification type
    uqsTest_forallx(de.upb.dmm.transformation.dmm2groove.tests.TransformationTest): StackMapTable format error: bad verification type
    testInvocationFailure(de.upb.dmm.transformation.dmm2groove.tests.FailingInvocationTest): StackMapTable format error: bad verification type

    Tests run: 12, Failures: 0, Errors: 12, Skipped: 0

    Let me know if you need more information!

     
  • Marc R. Hoffmann

    Can you please provide a complete stack trace? The class file MessageOperations$1.class is version 49.0 (Java 5) and does therefore not contain any StackMapFrames,

     
  • chris

    chris - 2012-07-14

    Here's one complete stack trace:

    java.lang.ClassFormatError: StackMapTable format error: bad verification type
    at groove.graph.GraphProperties.isValidUserKey(GraphProperties.java:335)
    at groove.graph.GraphProperties.isValidKey(GraphProperties.java:347)
    at groove.graph.GraphProperties.put(GraphProperties.java:58)
    at java.util.Properties.setProperty(Properties.java:143)
    at groove.io.DefaultGxlIO.gxlToAttrGraph(DefaultGxlIO.java:289)
    at groove.io.DefaultGxlIO.loadGraphWithMap(DefaultGxlIO.java:92)
    at groove.io.DefaultGxl.unmarshalGraphMap(DefaultGxl.java:92)
    at groove.io.LayedOutXml.unmarshalGraphMap(LayedOutXml.java:97)
    at groove.io.AbstractXml.unmarshalGraph(AbstractXml.java:44)
    at groove.io.AbstractXml.unmarshalGraph(AbstractXml.java:49)
    at groove.io.AbstractXml.unmarshalGraph(AbstractXml.java:1)
    at groove.io.DefaultFileSystemStore.collectRules(DefaultFileSystemStore.java:849)
    at groove.io.DefaultFileSystemStore.collectRules(DefaultFileSystemStore.java:846)
    at groove.io.DefaultFileSystemStore.loadRules(DefaultFileSystemStore.java:802)
    at groove.io.DefaultFileSystemStore.reload(DefaultFileSystemStore.java:617)
    at groove.view.StoredGrammarView.newInstance(StoredGrammarView.java:550)
    at groove.view.StoredGrammarView.newInstance(StoredGrammarView.java:533)
    at groove.util.Generator.computeGrammar(Generator.java:284)
    at groove.util.Generator.getGrammar(Generator.java:241)
    at groove.util.Generator.getGTS(Generator.java:229)
    at groove.util.Generator.generate(Generator.java:416)
    at groove.util.Generator.start(Generator.java:174)
    at de.upb.dmm.transformation.dmm2groove.tests.FailingInvocationTest.testInvocationFailure(FailingInvocationTest.java:66)
    at de.upb.dmm.transformation.dmm2groove.tests.FailingInvocationTest.runTest(FailingInvocationTest.java:84)
    at junit.framework.TestCase.runBare(TestCase.java:130)
    at junit.framework.TestResult$1.protect(TestResult.java:106)
    at junit.framework.TestResult.runProtected(TestResult.java:124)
    at junit.framework.TestResult.run(TestResult.java:109)
    at junit.framework.TestCase.run(TestCase.java:120)
    at junit.framework.TestSuite.runTest(TestSuite.java:230)
    at junit.framework.TestSuite.run(TestSuite.java:225)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    at org.apache.maven.surefire.junit.JUnitTestSet.execute(JUnitTestSet.java:96)
    at org.apache.maven.surefire.junit.JUnit3Provider.executeTestSet(JUnit3Provider.java:117)
    at org.apache.maven.surefire.junit.JUnit3Provider.invoke(JUnit3Provider.java:94)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    at org.apache.maven.surefire.util.ReflectionUtils.invokeMethodWithArray(ReflectionUtils.java:164)
    at org.apache.maven.surefire.booter.ProviderFactory$ProviderProxy.invoke(ProviderFactory.java:110)
    at org.apache.maven.surefire.booter.SurefireStarter.invokeProvider(SurefireStarter.java:175)
    at org.apache.maven.surefire.booter.SurefireStarter.runSuitesInProcess(SurefireStarter.java:123)
    at org.eclipse.tycho.surefire.osgibooter.OsgiSurefireBooter.run(OsgiSurefireBooter.java:84)
    at org.eclipse.tycho.surefire.osgibooter.HeadlessTestApplication.run(HeadlessTestApplication.java:21)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    at org.eclipse.equinox.internal.app.EclipseAppContainer.callMethodWithException(EclipseAppContainer.java:587)
    at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:198)
    at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110)
    at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79)
    at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:344)
    at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:179)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:622)
    at org.eclipse.equinox.launcher.Main.basicRun(Main.java:577)
    at org.eclipse.equinox.launcher.Main.run(Main.java:1410)
    at org.eclipse.equinox.launcher.Main.main(Main.java:1386)

    I take it that this time StackMapTable causes the problems. However, I just performed a Java search on my eclipse workspace (Search for: Type, Limit to: All occurences, Search in: everywhere), but I didn't find that class anywhere. Let me know if I can be of further assistance...

     
  • chris

    chris - 2012-07-14
     
  • chris

    chris - 2012-07-14

    Just in case I'm not understanding something fundamentally here (I have no clue about bytecode, instrumentation etc.), I attached the groove.graph.GraphProperties class...

     
  • Marc R. Hoffmann

    Thanks. Hm, I cannot identify any issues with this class. But it looks like the issue is related to Groove classes. So I will do some testing with Groove.

     
  • Marc R. Hoffmann

    Ups, sorry. Groove is a library, right? It's not Groovy, the language.

     
  • Marc R. Hoffmann

    Would it be possible to provide an example project that reproduces the issue?

     
  • chris

    chris - 2012-07-14

    Unfortunately not, since it is a rather complex beast (at least for my standards :-) ). However, if you want to, I would be willing to give you access to my build server and grant you the rights you need to investigate the issue - please contact me by email if this is the case.

    And right, Groove is a library (see http://groove.cs.utwente.nl/\). Note that I'm using a rather old and slightly patched version of Groove which I'm building myself.

     
  • Marc R. Hoffmann

    First of all, thanks for your help to investigate this issue!

    Here is what I would try next: Can you please add the option classdumpdir to the JaCoCo agent and specify a local directory path? This will dump all classes seen by the JaCoCo agent. Please zip the dumped lasses and attach them here.

     
  • chris

    chris - 2012-07-14

    That's probably going to be A LOT of classes, but I don't care :-) Will do this probably later today!

     
  • Marc R. Hoffmann

    Ok, don't worry, I will use automated test cases to verify the classes ;-)

    But if you want you can try to narrow down the classes with the JaCoCo agent option "includes". Just make sure that the error still occurs.

     
  • chris

    chris - 2012-07-14

    Ok, sounds good to me :-)

    I have added

    <classdumpdir>../de.upb.dmm.build/jacoco_class_dumps</classdumpdir>

    to my pom, and destfile is ../de.upb.dmm.build/jacoco.exec. However, the jacoco.exec file shows up as usual, but no jacoco_class_dumps dir. Did I configure this correctly? Does the dump dir need to exist already, or will jacoco create it if it's missing?

     
  • Marc R. Hoffmann

    It has to exist.

     
  • Marc R. Hoffmann

    Sorry, and in Maven the property is "classDumpDir".

     
1 2 > >> (Page 1 of 2)

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks