java.lang.IllegalStateException: Failed to transform class with name com.test.MyTestClass. Reason: PowerMock internal error when modifying method.

Searched on Google with the first line of a JAVA stack trace?

We can recommend more relevant solutions and speed up debugging when you paste your entire stack trace with the exception message. Try a sample exception.

Recommended solutions based on your search

Solutions on the web

via Stack Overflow by Brad Parks
, 1 year ago
Failed to transform class with name com.test.MyTestClass. Reason: PowerMock internal error when modifying method.
via tagwith.com by Unknown author, 2 years ago
Failed to transform class with name com.test.MyTestClass. Reason: PowerMock internal error when modifying method.
via Stack Overflow by bdparrish
, 1 year ago
Failed to transform class with name org.glassfish.jersey.test.JerseyTest. Reason: cannot find org.glassfish.jersey.logging.LoggingFeature$Verbosity
via codegur.com by Unknown author, 1 year ago
Failed to transform class with name org.glassfish.jersey.test.JerseyTest. Reason: cannot find org.glassfish.jersey.logging.LoggingFeature$Verbosity
via Stack Overflow by Seb
, 2 years ago
via Stack Overflow by ris8_allo_zen0
, 1 year ago
Failed to transform class with name android.view.View. Reason: by javassist.bytecode.BadBytecode: getVerticalFadingEdgeLength ()I in android.view.View: failed to resolve types
javassist.NotFoundException: mockStatic(..) is not found in org.powermock.api.mockito.PowerMockito
at javassist.CtClassType.getMethod(CtClassType.java:1130)
at javassist.expr.MethodCall.getMethod(MethodCall.java:115)
at javassist.expr.ExprEditor.loopBody(ExprEditor.java:192)
at javassist.expr.ExprEditor.doit(ExprEditor.java:91)
at javassist.CtClassType.instrument(CtClassType.java:1385)
at org.powermock.core.transformers.impl.MainMockTransformer.transform(MainMockTransformer.java:75)
at org.powermock.core.classloader.MockClassLoader.loadMockClass(MockClassLoader.java:203)
at org.powermock.core.classloader.MockClassLoader.loadModifiedClass(MockClassLoader.java:145)
at java.lang.ClassLoader.loadClass(ClassLoader.java:358)
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:800)
at java.lang.ClassLoader.defineClass(ClassLoader.java:643)
at org.powermock.core.classloader.MockClassLoader.loadMockClass(MockClassLoader.java:210)
at org.powermock.core.classloader.MockClassLoader.loadModifiedClass(MockClassLoader.java:145)
at java.lang.ClassLoader.loadClass(ClassLoader.java:358)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:270)
at org.powermock.modules.junit4.common.internal.impl.JUnit4TestSuiteChunkerImpl.createDelegatorFromClassloader(JUnit4TestSuiteChunkerImpl.java:133)
at org.powermock.modules.junit4.common.internal.impl.JUnit4TestSuiteChunkerImpl.(JUnit4TestSuiteChunkerImpl.java:59)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at org.junit.internal.builders.AnnotatedBuilder.buildRunner(AnnotatedBuilder.java:29)
at org.junit.internal.builders.AnnotatedBuilder.runnerForClass(AnnotatedBuilder.java:21)
at org.junit.runners.model.RunnerBuilder.safeRunnerForClass(RunnerBuilder.java:59)
at org.junit.internal.builders.AllDefaultPossibilitiesBuilder.runnerForClass(AllDefaultPossibilitiesBuilder.java:26)
at org.junit.runners.model.RunnerBuilder.safeRunnerForClass(RunnerBuilder.java:59)
at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.(JUnit4TestReference.java:33)
at org.eclipse.jdt.internal.junit4.runner.JUnit4TestClassReference.(JUnit4TestClassReference.java:25)
at org.eclipse.jdt.internal.junit4.runner.JUnit4TestLoader.createTest(JUnit4TestLoader.java:48)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:452)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)

Users with the same issue

Samebug visitor profile picture
Unknown user
Once, 1 year ago
Samebug visitor profile picture
Unknown user
Once, 2 years ago

Write tip

Know the solutions? Share your knowledge to help other developers to debug faster.