Thoppan / powermock

Automatically exported from code.google.com/p/powermock
Apache License 2.0
0 stars 0 forks source link

javassist Failed to transform class with name com.some.class. Reason: null #328

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
Environment:
eclipse, powermock 1.4.8, easymock 3, junit 4.8, javassist 3.14.0.GA

Hi,
i get this error while using the @PrepareForTest().

The code i try to perpare is 2500 lines long (i know bad bad bad code but it's 
not mine, i only need to test it). i do not want to post all. If you could help 
me to debug the hole file with javassist to find the methodes or statments that 
produces this error, i am happy to do so. Is there some debuging level or 
something to check where javassist crashes?

Thankyou for now

Yours,
Andreas

(note: already filed at jboss-javassist-jira: 
https://issues.jboss.org/browse/JASSIST-141)

and here the stacktrace:
java.lang.IllegalStateException: Failed to transform class with name 
com.some.class. Reason: null
at 
org.powermock.core.classloader.MockClassLoader.loadMockClass(MockClassLoader.jav
a:207)
at 
org.powermock.core.classloader.MockClassLoader.loadModifiedClass(MockClassLoader
.java:145)
at 
org.powermock.core.classloader.DeferSupportingClassLoader.loadClass(DeferSupport
ingClassLoader.java:65)
at java.lang.ClassLoader.loadClass(ClassLoader.java:248)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:247)
at 
sun.reflect.generics.factory.CoreReflectionFactory.makeNamedType(CoreReflectionF
actory.java:95)
at 
sun.reflect.generics.visitor.Reifier.visitClassTypeSignature(Reifier.java:107)
at 
sun.reflect.generics.tree.ClassTypeSignature.accept(ClassTypeSignature.java:31)
at sun.reflect.annotation.AnnotationParser.parseSig(AnnotationParser.java:370)
at 
sun.reflect.annotation.AnnotationParser.parseClassValue(AnnotationParser.java:35
1)
at 
sun.reflect.annotation.AnnotationParser.parseClassArray(AnnotationParser.java:65
3)
at sun.reflect.annotation.AnnotationParser.parseArray(AnnotationParser.java:460)
at 
sun.reflect.annotation.AnnotationParser.parseMemberValue(AnnotationParser.java:2
86)
at 
sun.reflect.annotation.AnnotationParser.parseAnnotation(AnnotationParser.java:22
2)
at 
sun.reflect.annotation.AnnotationParser.parseAnnotations2(AnnotationParser.java:
69)
at 
sun.reflect.annotation.AnnotationParser.parseAnnotations(AnnotationParser.java:5
2)
at java.lang.Class.initAnnotationsIfNecessary(Class.java:3070)
at java.lang.Class.getAnnotations(Class.java:3050)
at 
org.powermock.modules.junit4.internal.impl.PowerMockJUnit44RunnerDelegateImpl.cl
assAnnotations(PowerMockJUnit44RunnerDelegateImpl.java:163)
at 
org.powermock.modules.junit4.internal.impl.PowerMockJUnit44RunnerDelegateImpl.ge
tDescription(PowerMockJUnit44RunnerDelegateImpl.java:155)
at 
org.powermock.modules.junit4.common.internal.impl.JUnit4TestSuiteChunkerImpl.get
Description(JUnit4TestSuiteChunkerImpl.java:172)
at 
org.powermock.modules.junit4.common.internal.impl.AbstractCommonPowerMockRunner.
getDescription(AbstractCommonPowerMockRunner.java:47)
at 
org.eclipse.jdt.internal.junit4.runner.JUnit4TestClassReference.sendTree(JUnit4T
estClassReference.java:38)
at 
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.sendTrees(RemoteTestRunne
r.java:476)
at 
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner
.java:464)
at 
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner
.java:683)
at 
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java
:390)
at 
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.jav
a:197)
Caused by: java.lang.NullPointerException
at javassist.bytecode.stackmap.Tracer.checkParamTypes(Tracer.java:888)
at javassist.bytecode.stackmap.Tracer.doInvokeMethod(Tracer.java:822)
at javassist.bytecode.stackmap.Tracer.doOpcode148_201(Tracer.java:620)
at javassist.bytecode.stackmap.Tracer.doOpcode(Tracer.java:102)
at javassist.bytecode.stackmap.MapMaker.make(MapMaker.java:182)
at javassist.bytecode.stackmap.MapMaker.traceException(MapMaker.java:213)
at javassist.bytecode.stackmap.MapMaker.make(MapMaker.java:175)
at javassist.bytecode.stackmap.MapMaker.make(MapMaker.java:192)
at javassist.bytecode.stackmap.MapMaker.make(MapMaker.java:192)
================================================================================
=====================================
243 times this line : at 
javassist.bytecode.stackmap.MapMaker.make(MapMaker.java:192)
================================================================================
=====================================
at javassist.bytecode.stackmap.MapMaker.make(MapMaker.java:141)
at javassist.bytecode.stackmap.MapMaker.make(MapMaker.java:96)
at javassist.bytecode.MethodInfo.rebuildStackMap(MethodInfo.java:416)
at javassist.bytecode.MethodInfo.rebuildStackMapIf6(MethodInfo.java:398)
at javassist.expr.ExprEditor.doit(ExprEditor.java:112)
at javassist.CtClassType.instrument(CtClassType.java:1384)
at 
org.powermock.core.transformers.impl.MainMockTransformer.transform(MainMockTrans
former.java:77)
at 
org.powermock.core.classloader.MockClassLoader.loadMockClass(MockClassLoader.jav
a:203)
... 28 more

ty

Original issue reported on code.google.com by info.ame...@gmail.com on 17 May 2011 at 1:47

GoogleCodeExporter commented 9 years ago
Thanks for letting us know. If it's a javassist bug then there's not we can do 
I suppose but wait for the next version to be released.

Original comment by johan.ha...@gmail.com on 19 May 2011 at 7:06

GoogleCodeExporter commented 9 years ago

Original comment by johan.ha...@gmail.com on 16 Jun 2011 at 2:49