openjpa-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Kevin Sutter (JIRA)" <>
Subject [jira] [Commented] (OPENJPA-2339) OpenJPA Ant enhancer task generates .class files with missing stackmap frame
Date Wed, 27 Feb 2013 21:43:16 GMT


Kevin Sutter commented on OPENJPA-2339:

It would seem that your JoCoCo project is doing more validation of the class files than normal
Java 6 runtime processing.  The stackmap issues became apparent when customers moved to the
more stringent Java 7.  If you google this topic, you'll find that just all bytecode manipulation
utilities (asm, serp, etc) had issues when first running with Java 7.  Java 6 (and previous
versions) had been more tolerant of stackmap inconsistencies.  But, that was no longer the
case with Java 7.

So, to support Java 7, OpenJPA introduced the use of ASM to clean up our stackmap table entries
after Serp did the initial bytecode enhancement.  But, we only do this extra processing when
we detect a Java 7 class file.  Thus, Rick's suggestion of trying Java 7 is probably worthwhile.

Also, just to explain the changes in openjpa-2298...  These changes would apply to either
Java 6 or Java 7 environments.  But, based on your stated issues, I doubt that this change
alone would get you up and running.  You'll probably need the ASM post-processing cleanup
of the stackmap tables.
> OpenJPA Ant enhancer task generates .class files with missing stackmap frame
> ----------------------------------------------------------------------------
>                 Key: OPENJPA-2339
>                 URL:
>             Project: OpenJPA
>          Issue Type: Bug
>    Affects Versions: 2.2.0, 2.2.1
>         Environment: OpenJPA 2.2.0 & 2.2.1, JaCoCo latest from git, Java 6
>            Reporter: Dominik Stadler
>            Assignee: Kevin Sutter
>            Priority: Critical
>         Attachments:
> I have a project which uses JaCoCo for code-coverage testing. Some of the tests load
JPA Entities.
> Any JPA entities cause error messages "Missing or invalid stackmap frames." in JaCoCo
code, which the developers of JaCoco indicate is a problem in the code enhancing the .class
file before, i.e. here Open JPA Enhancer. 
> OPENJPA-2085 seems related, but it is fixed in 2.2.0, which I am using. Was this only
fixed for Java 7?
> I also upgraded to serp-1.14.1, which seems to have some related fixes, but the problem
> See for a related discussion.
> See the attached sample project/ant-file which reproduces the problem. Simply run "ant
test" to trigger the error.
> A full stacktrace is 
>     [junit] Running MandantTest
>     [junit] java.lang.instrument.IllegalClassFormatException: Error while instrumenting
class Mandant.
>     [junit]     at org.jacoco.agent.rt.internal_f6710df.CoverageTransformer.transform(
>     [junit]     at sun.instrument.TransformerManager.transform(
>     [junit]     at sun.instrument.InstrumentationImpl.transform(
>     [junit]     at java.lang.ClassLoader.defineClass1(Native Method)
>     [junit]     at java.lang.ClassLoader.defineClass(
>     [junit]     at
>     [junit]     at
>     [junit]     at$000(
>     [junit]     at$
>     [junit]     at Method)
>     [junit]     at
>     [junit]     at java.lang.ClassLoader.loadClass(
>     [junit]     at sun.misc.Launcher$AppClassLoader.loadClass(
>     [junit]     at java.lang.ClassLoader.loadClass(
>     [junit]     at MandantTest.test(
>     [junit]     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>     [junit]     at sun.reflect.NativeMethodAccessorImpl.invoke(
>     [junit]     at sun.reflect.DelegatingMethodAccessorImpl.invoke(
>     [junit]     at java.lang.reflect.Method.invoke(
>     [junit]     at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(
>     [junit]     at
>     [junit]     at org.junit.runners.model.FrameworkMethod.invokeExplosively(
>     [junit]     at org.junit.internal.runners.statements.InvokeMethod.evaluate(
>     [junit]     at org.junit.runners.BlockJUnit4ClassRunner.runNotIgnored(
>     [junit]     at org.junit.runners.BlockJUnit4ClassRunner.runChild(
>     [junit]     at org.junit.runners.BlockJUnit4ClassRunner.runChild(
>     [junit]     at org.junit.runners.ParentRunner$
>     [junit]     at org.junit.runners.ParentRunner$1.schedule(
>     [junit]     at org.junit.runners.ParentRunner.runChildren(
>     [junit]     at org.junit.runners.ParentRunner.access$000(
>     [junit]     at org.junit.runners.ParentRunner$2.evaluate(
>     [junit]     at
>     [junit]     at
>     [junit]     at
>     [junit]     at
>     [junit] Caused by: java.lang.IllegalStateException: Missing or invalid stackmap frames.
>     [junit]     at org.jacoco.agent.rt.internal_f6710df.core.internal.instr.FrameTracker.assertValidFrames(
>     [junit]     at org.jacoco.agent.rt.internal_f6710df.core.internal.instr.FrameTracker.pop(
>     [junit]     at org.jacoco.agent.rt.internal_f6710df.core.internal.instr.FrameTracker.visitVarInsn(
>     [junit]     at org.jacoco.agent.rt.internal_f6710df.asm.MethodVisitor.visitVarInsn(Unknown
>     [junit]     at org.jacoco.agent.rt.internal_f6710df.asm.MethodVisitor.visitVarInsn(Unknown
>     [junit]     at org.jacoco.agent.rt.internal_f6710df.asm.tree.VarInsnNode.accept(Unknown
>     [junit]     at org.jacoco.agent.rt.internal_f6710df.asm.tree.InsnList.accept(Unknown
>     [junit]     at org.jacoco.agent.rt.internal_f6710df.asm.tree.MethodNode.accept(Unknown
>     [junit]     at org.jacoco.agent.rt.internal_f6710df.core.internal.flow.ClassProbesAdapter$1.visitEnd(
>     [junit]     at org.jacoco.agent.rt.internal_f6710df.asm.ClassReader.b(Unknown Source)
>     [junit]     at org.jacoco.agent.rt.internal_f6710df.asm.ClassReader.accept(Unknown
>     [junit]     at org.jacoco.agent.rt.internal_f6710df.asm.ClassReader.accept(Unknown
>     [junit]     at org.jacoco.agent.rt.internal_f6710df.core.instr.Instrumenter.instrument(
>     [junit]     at org.jacoco.agent.rt.internal_f6710df.core.instr.Instrumenter.instrument(
>     [junit]     at org.jacoco.agent.rt.internal_f6710df.CoverageTransformer.transform(
>     [junit]     ... 34 more

This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see:

View raw message