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

Stack Overflow | Brad Parks | 3 years ago
tip
Do you know that we can give you better hits? Get more relevant results from Samebug’s stack trace search.
  1. 0

    java.lang.IllegalStateException: Failed to transform class with … Reason: PowerMock internal error when modifying method.

    tagwith.com | 1 year ago
    java.lang.IllegalStateException: Failed to transform class with name com.test.MyTestClass. Reason: PowerMock internal error when modifying method.
  2. 0

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

    Stack Overflow | 3 years ago | Brad Parks
    java.lang.IllegalStateException: Failed to transform class with name com.test.MyTestClass. Reason: PowerMock internal error when modifying method.
  3. Speed up your debug routine!

    Automated exception search integrated into your IDE

  4. 0

    java.lang.IllegalStateException: Failed to transform class Reason: PowerMock internal error when modifying method.

    GitHub | 2 years ago | johanhaleby
    java.lang.IllegalStateException: Failed to transform class with name uk.ac.open.util.DebuggerTest. Reason: PowerMock internal error when modifying method.

    2 unregistered visitors

    Root Cause Analysis

    1. javassist.NotFoundException

      mockStatic(..) is not found in org.powermock.api.mockito.PowerMockito

      at javassist.CtClassType.getMethod()
    2. Javassist
      MethodCall.getMethod
      1. javassist.CtClassType.getMethod(CtClassType.java:1130)
      2. javassist.expr.MethodCall.getMethod(MethodCall.java:115)
      2 frames
    3. powermock-core
      MainMockTransformer$PowerMockExpressionEditor.edit
      1. org.powermock.core.transformers.impl.MainMockTransformer$PowerMockExpressionEditor.edit(MainMockTransformer.java:283)
      1 frame
    4. Javassist
      CtClassType.instrument
      1. javassist.expr.ExprEditor.loopBody(ExprEditor.java:192)
      2. javassist.expr.ExprEditor.doit(ExprEditor.java:91)
      3. javassist.CtClassType.instrument(CtClassType.java:1385)
      3 frames
    5. powermock-core
      DeferSupportingClassLoader.loadClass
      1. org.powermock.core.transformers.impl.MainMockTransformer.transform(MainMockTransformer.java:75)
      2. org.powermock.core.classloader.MockClassLoader.loadMockClass(MockClassLoader.java:203)
      3. org.powermock.core.classloader.MockClassLoader.loadModifiedClass(MockClassLoader.java:145)
      4. org.powermock.core.classloader.DeferSupportingClassLoader.loadClass(DeferSupportingClassLoader.java:67)
      4 frames
    6. Java RT
      ClassLoader.defineClass
      1. java.lang.ClassLoader.loadClass(ClassLoader.java:358)
      2. java.lang.ClassLoader.defineClass1(Native Method)
      3. java.lang.ClassLoader.defineClass(ClassLoader.java:800)
      4. java.lang.ClassLoader.defineClass(ClassLoader.java:643)
      4 frames
    7. powermock-core
      DeferSupportingClassLoader.loadClass
      1. org.powermock.core.classloader.MockClassLoader.loadMockClass(MockClassLoader.java:210)
      2. org.powermock.core.classloader.MockClassLoader.loadModifiedClass(MockClassLoader.java:145)
      3. org.powermock.core.classloader.DeferSupportingClassLoader.loadClass(DeferSupportingClassLoader.java:67)
      3 frames
    8. Java RT
      Class.forName
      1. java.lang.ClassLoader.loadClass(ClassLoader.java:358)
      2. java.lang.Class.forName0(Native Method)
      3. java.lang.Class.forName(Class.java:270)
      3 frames
    9. powermock-module-junit4-common
      JUnit4TestSuiteChunkerImpl.createDelegatorFromClassloader
      1. org.powermock.modules.junit4.common.internal.impl.JUnit4TestSuiteChunkerImpl.createDelegatorFromClassloader(JUnit4TestSuiteChunkerImpl.java:133)
      2. org.powermock.modules.junit4.common.internal.impl.JUnit4TestSuiteChunkerImpl.createDelegatorFromClassloader(JUnit4TestSuiteChunkerImpl.java:39)
      2 frames
    10. powermock-core
      AbstractTestSuiteChunkerImpl.createTestDelegators
      1. org.powermock.tests.utils.impl.AbstractTestSuiteChunkerImpl.createTestDelegators(AbstractTestSuiteChunkerImpl.java:217)
      1 frame
    11. powermock-module-junit4-common
      AbstractCommonPowerMockRunner.<init>
      1. org.powermock.modules.junit4.common.internal.impl.JUnit4TestSuiteChunkerImpl.<init>(JUnit4TestSuiteChunkerImpl.java:59)
      2. org.powermock.modules.junit4.common.internal.impl.AbstractCommonPowerMockRunner.<init>(AbstractCommonPowerMockRunner.java:32)
      2 frames
    12. powermock-module-junit4
      PowerMockRunner.<init>
      1. org.powermock.modules.junit4.PowerMockRunner.<init>(PowerMockRunner.java:31)
      1 frame
    13. Java RT
      Constructor.newInstance
      1. sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
      2. sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
      3. sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
      4. java.lang.reflect.Constructor.newInstance(Constructor.java:526)
      4 frames
    14. JUnit
      ClassRequest.getRunner
      1. org.junit.internal.builders.AnnotatedBuilder.buildRunner(AnnotatedBuilder.java:29)
      2. org.junit.internal.builders.AnnotatedBuilder.runnerForClass(AnnotatedBuilder.java:21)
      3. org.junit.runners.model.RunnerBuilder.safeRunnerForClass(RunnerBuilder.java:59)
      4. org.junit.internal.builders.AllDefaultPossibilitiesBuilder.runnerForClass(AllDefaultPossibilitiesBuilder.java:26)
      5. org.junit.runners.model.RunnerBuilder.safeRunnerForClass(RunnerBuilder.java:59)
      6. org.junit.internal.requests.ClassRequest.getRunner(ClassRequest.java:26)
      6 frames
    15. JUnit4 Runner
      JUnit4TestLoader.loadTests
      1. org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.<init>(JUnit4TestReference.java:33)
      2. org.eclipse.jdt.internal.junit4.runner.JUnit4TestClassReference.<init>(JUnit4TestClassReference.java:25)
      3. org.eclipse.jdt.internal.junit4.runner.JUnit4TestLoader.createTest(JUnit4TestLoader.java:48)
      4. org.eclipse.jdt.internal.junit4.runner.JUnit4TestLoader.loadTests(JUnit4TestLoader.java:38)
      4 frames
    16. JUnit3 Runner
      RemoteTestRunner.main
      1. org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:452)
      2. org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)
      3. org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)
      4. org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)
      4 frames