We are using powermockito in our junit test cases and facing this issue while executing it with java 8
Caused by: java.lang.RuntimeException: java.io.IOException: invalid constant type: 15
at javassist.CtClassType.getClassFile2(CtClassType.java:203)
at javassist.CtClassType.makeFieldCache(CtClassType.java:837)
at javassist.CtClassType.getMembers(CtClassType.java:828)
at javassist.CtClassType.getMethod0(CtClassType.java:1126)
at javassist.CtClassType.getMethod(CtClassType.java:1115)
at javassist.expr.MethodCall.getMethod(MethodCall.java:114)
at org.powermock.core.transformers.impl.MainMockTransformer$PowerMockExpressionEditor.edit(MainMockTransformer.java:272)
at javassist.expr.ExprEditor.loopBody(ExprEditor.java:191)
at javassist.expr.ExprEditor.doit(ExprEditor.java:90)
at javassist.CtClassType.instrument(CtClassType.java:1374)
at org.powermock.core.transformers.impl.MainMockTransformer.transform(MainMockTransformer.java:74)
at org.powermock.core.classloader.MockClassLoader.loadMockClass(MockClassLoader.java:252)
... 60 more
Caused by: java.io.IOException: invalid constant type: 15
at javassist.bytecode.ConstPool.readOne(ConstPool.java:1090)
at javassist.bytecode.ConstPool.read(ConstPool.java:1033)
at javassist.bytecode.ConstPool.(ConstPool.java:149)
at javassist.bytecode.ClassFile.read(ClassFile.java:737)
at javassist.bytecode.ClassFile.(ClassFile.java:108)
at javassist.CtClassType.getClassFile2(CtClassType.java:190)
... 71 more
Tried with different versions of javassist still issue is persisting.
Tried executing the test case with java 7 and it is working fine.
Is there any solution or workaround to handle the same with Java8 as our application need to be build with Java8.
IIRC Javassist is not compatible with Java 8. In any case, it's not a JUnit issue since it doesn't use Javassist and you're probably better of searching/asking on StackOverflow.
Hi team,
We are using powermockito in our junit test cases and facing this issue while executing it with java 8
Caused by: java.lang.RuntimeException: java.io.IOException: invalid constant type: 15 at javassist.CtClassType.getClassFile2(CtClassType.java:203) at javassist.CtClassType.makeFieldCache(CtClassType.java:837) at javassist.CtClassType.getMembers(CtClassType.java:828) at javassist.CtClassType.getMethod0(CtClassType.java:1126) at javassist.CtClassType.getMethod(CtClassType.java:1115) at javassist.expr.MethodCall.getMethod(MethodCall.java:114) at org.powermock.core.transformers.impl.MainMockTransformer$PowerMockExpressionEditor.edit(MainMockTransformer.java:272) at javassist.expr.ExprEditor.loopBody(ExprEditor.java:191) at javassist.expr.ExprEditor.doit(ExprEditor.java:90) at javassist.CtClassType.instrument(CtClassType.java:1374) at org.powermock.core.transformers.impl.MainMockTransformer.transform(MainMockTransformer.java:74) at org.powermock.core.classloader.MockClassLoader.loadMockClass(MockClassLoader.java:252) ... 60 more Caused by: java.io.IOException: invalid constant type: 15 at javassist.bytecode.ConstPool.readOne(ConstPool.java:1090) at javassist.bytecode.ConstPool.read(ConstPool.java:1033) at javassist.bytecode.ConstPool.(ConstPool.java:149)
at javassist.bytecode.ClassFile.read(ClassFile.java:737)
at javassist.bytecode.ClassFile.(ClassFile.java:108)
at javassist.CtClassType.getClassFile2(CtClassType.java:190)
... 71 more
Tried with different versions of javassist still issue is persisting. Tried executing the test case with java 7 and it is working fine. Is there any solution or workaround to handle the same with Java8 as our application need to be build with Java8.
Please Suggest Thanks in Advance!