[
https://issues.jboss.org/browse/JASSIST-160?page=com.atlassian.jira.plugi...
]
John Bainbridge commented on JASSIST-160:
-----------------------------------------
I just pull trunk and i noticed that this fixed most of the promblems however not all.
Here are my stack traces:
Exception in thread "main" java.lang.IllegalStateException: Failed to transform
class with name xxx.xxxxx.xxxxx.xxxxxx. Reason: null
at
org.powermock.core.classloader.MockClassLoader.loadMockClass(MockClassLoader.java:207)
at
org.powermock.core.classloader.MockClassLoader.loadModifiedClass(MockClassLoader.java:145)
at
org.powermock.core.classloader.DeferSupportingClassLoader.loadClass(DeferSupportingClassLoader.java:67)
at java.lang.ClassLoader.loadClass(ClassLoader.java:356)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:264)
at
sun.reflect.generics.factory.CoreReflectionFactory.makeNamedType(CoreReflectionFactory.java:114)
at sun.reflect.generics.visitor.Reifier.visitClassTypeSignature(Reifier.java:125)
at sun.reflect.generics.tree.ClassTypeSignature.accept(ClassTypeSignature.java:49)
at sun.reflect.annotation.AnnotationParser.parseSig(AnnotationParser.java:390)
at sun.reflect.annotation.AnnotationParser.parseClassValue(AnnotationParser.java:371)
at sun.reflect.annotation.AnnotationParser.parseClassArray(AnnotationParser.java:673)
at sun.reflect.annotation.AnnotationParser.parseArray(AnnotationParser.java:480)
at sun.reflect.annotation.AnnotationParser.parseMemberValue(AnnotationParser.java:306)
at sun.reflect.annotation.AnnotationParser.parseAnnotation(AnnotationParser.java:241)
at sun.reflect.annotation.AnnotationParser.parseAnnotations2(AnnotationParser.java:88)
at sun.reflect.annotation.AnnotationParser.parseAnnotations(AnnotationParser.java:70)
at java.lang.Class.initAnnotationsIfNecessary(Class.java:3089)
at java.lang.Class.getAnnotations(Class.java:3069)
at
org.powermock.modules.junit4.internal.impl.PowerMockJUnit44RunnerDelegateImpl.classAnnotations(PowerMockJUnit44RunnerDelegateImpl.java:165)
at
org.powermock.modules.junit4.internal.impl.PowerMockJUnit44RunnerDelegateImpl.getDescription(PowerMockJUnit44RunnerDelegateImpl.java:157)
at
org.powermock.modules.junit4.common.internal.impl.JUnit4TestSuiteChunkerImpl.getDescription(JUnit4TestSuiteChunkerImpl.java:172)
at
org.powermock.modules.junit4.common.internal.impl.AbstractCommonPowerMockRunner.getDescription(AbstractCommonPowerMockRunner.java:47)
at org.powermock.modules.junit4.PowerMockRunner.run(PowerMockRunner.java:40)
at junit.framework.JUnit4TestAdapter.run(JUnit4TestAdapter.java:39)
at
org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.run(JUnitTestRunner.java:520)
at
org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.launch(JUnitTestRunner.java:1060)
at
org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.main(JUnitTestRunner.java:884)
Caused by: java.lang.NullPointerException
at javassist.bytecode.stackmap.TypeData.commonSuperClassEx(TypeData.java:400)
at javassist.bytecode.stackmap.TypeData$TypeVar.fixTypes2(TypeData.java:342)
at javassist.bytecode.stackmap.TypeData$TypeVar.fixTypes(TypeData.java:325)
at javassist.bytecode.stackmap.TypeData$TypeVar.dfs(TypeData.java:270)
at javassist.bytecode.stackmap.MapMaker.fixTypes(MapMaker.java:287)
at javassist.bytecode.stackmap.MapMaker.make(MapMaker.java:140)
at javassist.bytecode.stackmap.MapMaker.make(MapMaker.java:99)
at javassist.bytecode.MethodInfo.rebuildStackMap(MethodInfo.java:423)
at javassist.bytecode.MethodInfo.rebuildStackMapIf6(MethodInfo.java:405)
at javassist.expr.ExprEditor.doit(ExprEditor.java:113)
at javassist.CtClassType.instrument(CtClassType.java:1398)
at
org.powermock.core.transformers.impl.MainMockTransformer.transform(MainMockTransformer.java:75)
at
org.powermock.core.classloader.MockClassLoader.loadMockClass(MockClassLoader.java:203)
... 27 more
and :
java.lang.VerifyError: Stack map does not match the one at exception handler 2290 in
method xxx.xxxxx.xxx.xxxxxxx.xxxxxxxx()Ljava/lang/String; at offset 686
at java.lang.Class.getDeclaredMethods0(Native Method)
at java.lang.Class.privateGetDeclaredMethods(Class.java:2442)
at java.lang.Class.getMethod0(Class.java:2685)
at java.lang.Class.getMethod(Class.java:1620)
at org.easymock.internal.ObjectMethodsFilter.<init>(ObjectMethodsFilter.java:55)
at org.easymock.internal.MocksControl.createMock(MocksControl.java:59)
at org.powermock.api.easymock.PowerMock.doCreateMock(PowerMock.java:2212)
at org.powermock.api.easymock.PowerMock.doMock(PowerMock.java:2163)
at org.powermock.api.easymock.PowerMock.createMock(PowerMock.java:89)
at xxx.xxxx.xxx.xxxx.xxxxxxxxxxxxxxTest.testxxxxxxxxxx(xxxxxxxxxxxxxxTest.java:93)
at
org.powermock.modules.junit4.internal.impl.PowerMockJUnit44RunnerDelegateImpl$PowerMockJUnit44MethodRunner.runTestMethod(PowerMockJUnit44RunnerDelegateImpl.java:312)
at
org.powermock.modules.junit4.internal.impl.PowerMockJUnit44RunnerDelegateImpl$PowerMockJUnit44MethodRunner.executeTest(PowerMockJUnit44RunnerDelegateImpl.java:296)
at
org.powermock.modules.junit4.internal.impl.PowerMockJUnit47RunnerDelegateImpl$PowerMockJUnit47MethodRunner.executeTestInSuper(PowerMockJUnit47RunnerDelegateImpl.java:112)
at
org.powermock.modules.junit4.internal.impl.PowerMockJUnit47RunnerDelegateImpl$PowerMockJUnit47MethodRunner.executeTest(PowerMockJUnit47RunnerDelegateImpl.java:73)
at
org.powermock.modules.junit4.internal.impl.PowerMockJUnit44RunnerDelegateImpl$PowerMockJUnit44MethodRunner.runBeforesThenTestThenAfters(PowerMockJUnit44RunnerDelegateImpl.java:284)
at
org.powermock.modules.junit4.internal.impl.PowerMockJUnit44RunnerDelegateImpl.invokeTestMethod(PowerMockJUnit44RunnerDelegateImpl.java:209)
at
org.powermock.modules.junit4.internal.impl.PowerMockJUnit44RunnerDelegateImpl.runMethods(PowerMockJUnit44RunnerDelegateImpl.java:148)
at
org.powermock.modules.junit4.internal.impl.PowerMockJUnit44RunnerDelegateImpl$1.run(PowerMockJUnit44RunnerDelegateImpl.java:122)
at
org.powermock.modules.junit4.internal.impl.PowerMockJUnit44RunnerDelegateImpl.run(PowerMockJUnit44RunnerDelegateImpl.java:120)
at
org.powermock.modules.junit4.common.internal.impl.JUnit4TestSuiteChunkerImpl.run(JUnit4TestSuiteChunkerImpl.java:102)
at
org.powermock.modules.junit4.common.internal.impl.AbstractCommonPowerMockRunner.run(AbstractCommonPowerMockRunner.java:53)
at org.powermock.modules.junit4.PowerMockRunner.run(PowerMockRunner.java:42)
Java.lang.VerifyErrors occur in specific cases when using javaassist
with Java 1.7
----------------------------------------------------------------------------------
Key: JASSIST-160
URL:
https://issues.jboss.org/browse/JASSIST-160
Project: Javassist
Issue Type: Bug
Affects Versions: 3.16.1-GA
Environment: jdk1.7.0_03 on Windows XP SP 3
Reporter: Avner Singerman
Assignee: Shigeru Chiba
Fix For: 3.17.0-GA
Attachments: jatest.zip
We found at least two different cases where inserting bytecode using javaassist results
in a class that cannot be loaded with Java 1.7.
java.lang.VerifyError: Inconsistent stackmap frames at branch target
java.lang.VerifyError: Bad return type in method
The exact same code injection on the exact same classes works fine with Java 1.6.
We upgraded to the latest version of javaassist - 3.16.1.GA, but it didn't solve the
problem.
I'm attaching to this bug a self contained example where you can see both type of
errors.
More details in "Steps to Reproduce".
--
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:
http://www.atlassian.com/software/jira