java.io.IOException: invalid constant type: 18" type="java.lang.IllegalStateException">java.lang.IllegalStateException: Failed to transform class with name org.openmrs.module.web.WebModuleUtilTest. Reason: java.io.IOException: invalid constant type: 18

JIRA | Wesley Brown | 2 years ago
  1. 0

    The initializationError test in the WebModuleUtilTest class throws an exception when running under Java 8. <error message="Failed to transform class with name org.openmrs.module.web.WebModuleUtilTest. Reason: java.io.IOException: invalid constant type: 18" type="java.lang.IllegalStateException">java.lang.IllegalStateException: Failed to transform class with name org.openmrs.module.web.WebModuleUtilTest. Reason: java.io.IOException: invalid constant type: 18 at org.powermock.core.classloader.MockClassLoader.loadMockClass(MockClassLoader.java:219) at org.powermock.core.classloader.MockClassLoader.loadModifiedClass(MockClassLoader.java:147) at org.powermock.core.classloader.DeferSupportingClassLoader.loadClass(DeferSupportingClassLoader.java:67) at java.lang.ClassLoader.loadClass(ClassLoader.java:357) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:340) at org.powermock.modules.junit4.common.internal.impl.JUnit4TestSuiteChunkerImpl.createDelegatorFromClassloader(JUnit4TestSuiteChunkerImpl.java:132) at org.powermock.modules.junit4.common.internal.impl.JUnit4TestSuiteChunkerImpl.createDelegatorFromClassloader(JUnit4TestSuiteChunkerImpl.java:39) at org.powermock.tests.utils.impl.AbstractTestSuiteChunkerImpl.createTestDelegators(AbstractTestSuiteChunkerImpl.java:217) at org.powermock.modules.junit4.common.internal.impl.JUnit4TestSuiteChunkerImpl.&lt;init&gt;(JUnit4TestSuiteChunkerImpl.java:59) at org.powermock.modules.junit4.common.internal.impl.AbstractCommonPowerMockRunner.&lt;init&gt;(AbstractCommonPowerMockRunner.java:32) at org.powermock.modules.junit4.PowerMockRunner.&lt;init&gt;(PowerMockRunner.java:33) at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) at java.lang.reflect.Constructor.newInstance(Constructor.java:408) 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.junit.internal.requests.ClassRequest.getRunner(ClassRequest.java:26) at org.apache.maven.surefire.junit4.JUnit4TestSet.execute(JUnit4TestSet.java:51) at org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.executeTestSet(AbstractDirectoryTestSuite.java:115) at org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.execute(AbstractDirectoryTestSuite.java:102) at org.apache.maven.surefire.Surefire.run(Surefire.java:180) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:483) at org.apache.maven.surefire.booter.SurefireBooter.runSuitesInProcess(SurefireBooter.java:350) at org.apache.maven.surefire.booter.SurefireBooter.main(SurefireBooter.java:1021) Caused by: java.lang.RuntimeException: java.io.IOException: invalid constant type: 18 at javassist.CtClassType.getClassFile2(CtClassType.java:203) at javassist.CtClassType.subtypeOf(CtClassType.java:303) at javassist.bytecode.stackmap.TypeData$TypeName.update(TypeData.java:274) at javassist.bytecode.stackmap.TypeData$TypeName.setType(TypeData.java:203) at javassist.bytecode.stackmap.TypeData.setType(TypeData.java:46) at javassist.bytecode.stackmap.Tracer.checkParamTypes(Tracer.java:913) at javassist.bytecode.stackmap.Tracer.doInvokeMethod(Tracer.java:818) at javassist.bytecode.stackmap.Tracer.doOpcode148_201(Tracer.java:615) at javassist.bytecode.stackmap.Tracer.doOpcode(Tracer.java:101) at javassist.bytecode.stackmap.MapMaker.make(MapMaker.java:182) at javassist.bytecode.stackmap.MapMaker.make(MapMaker.java:192) at javassist.bytecode.stackmap.MapMaker.make(MapMaker.java:192) at javassist.bytecode.stackmap.MapMaker.make(MapMaker.java:192) at javassist.bytecode.stackmap.MapMaker.make(MapMaker.java:192) at javassist.bytecode.stackmap.MapMaker.make(MapMaker.java:192) at javassist.bytecode.stackmap.MapMaker.make(MapMaker.java:192) at javassist.bytecode.stackmap.MapMaker.make(MapMaker.java:192) at javassist.bytecode.stackmap.MapMaker.make(MapMaker.java:192) at javassist.bytecode.stackmap.MapMaker.make(MapMaker.java:192) at javassist.bytecode.stackmap.MapMaker.make(MapMaker.java:192) at javassist.bytecode.stackmap.MapMaker.make(MapMaker.java:192) at javassist.bytecode.stackmap.MapMaker.make(MapMaker.java:192) at javassist.bytecode.stackmap.MapMaker.make(MapMaker.java:192) at javassist.bytecode.stackmap.MapMaker.make(MapMaker.java:192) at javassist.bytecode.stackmap.MapMaker.make(MapMaker.java:192) at javassist.bytecode.stackmap.MapMaker.make(MapMaker.java:192) at javassist.bytecode.stackmap.MapMaker.make(MapMaker.java:192) at javassist.bytecode.stackmap.MapMaker.make(MapMaker.java:192) at javassist.bytecode.stackmap.MapMaker.make(MapMaker.java:192) at javassist.bytecode.stackmap.MapMaker.make(MapMaker.java:192) at javassist.bytecode.stackmap.MapMaker.make(MapMaker.java:192) at javassist.bytecode.stackmap.MapMaker.make(MapMaker.java:192) at javassist.bytecode.stackmap.MapMaker.make(MapMaker.java:192) at javassist.bytecode.stackmap.MapMaker.make(MapMaker.java:192) at javassist.bytecode.stackmap.MapMaker.make(MapMaker.java:192) at javassist.bytecode.stackmap.MapMaker.make(MapMaker.java:192) at javassist.bytecode.stackmap.MapMaker.make(MapMaker.java:192) at javassist.bytecode.stackmap.MapMaker.make(MapMaker.java:192) at javassist.bytecode.stackmap.MapMaker.make(MapMaker.java:192) at javassist.bytecode.stackmap.MapMaker.make(MapMaker.java:192) at javassist.bytecode.stackmap.MapMaker.make(MapMaker.java:192) at javassist.bytecode.stackmap.MapMaker.make(MapMaker.java:192) at javassist.bytecode.stackmap.MapMaker.make(MapMaker.java:192) at javassist.bytecode.stackmap.MapMaker.make(MapMaker.java:192) 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:1374) at org.powermock.core.transformers.impl.MainMockTransformer.transform(MainMockTransformer.java:75) at org.powermock.core.classloader.MockClassLoader.loadMockClass(MockClassLoader.java:215) ... 31 more Caused by: java.io.IOException: invalid constant type: 18 at javassist.bytecode.ConstPool.readOne(ConstPool.java:1090) at javassist.bytecode.ConstPool.read(ConstPool.java:1033) at javassist.bytecode.ConstPool.&lt;init&gt;(ConstPool.java:149) at javassist.bytecode.ClassFile.read(ClassFile.java:737) at javassist.bytecode.ClassFile.&lt;init&gt;(ClassFile.java:108) at javassist.CtClassType.getClassFile2(CtClassType.java:190) ... 83 more </error>

    JIRA | 2 years ago | Wesley Brown
    java.io.IOException: invalid constant type: 18" type="java.lang.IllegalStateException">java.lang.IllegalStateException: Failed to transform class with name org.openmrs.module.web.WebModuleUtilTest. Reason: java.io.IOException: invalid constant type: 18
  2. Speed up your debug routine!

    Automated exception search integrated into your IDE

    Not finding the right solution?
    Take a tour to get the most out of Samebug.

    Tired of useless tips?

    Automated exception search integrated into your IDE

    Root Cause Analysis

    1. java.io.IOException

      invalid constant type: 18" type="java.lang.IllegalStateException">java.lang.IllegalStateException: Failed to transform class with name org.openmrs.module.web.WebModuleUtilTest. Reason: java.io.IOException: invalid constant type: 18

      at org.powermock.core.classloader.MockClassLoader.loadMockClass()
    2. powermock-core
      DeferSupportingClassLoader.loadClass
      1. org.powermock.core.classloader.MockClassLoader.loadMockClass(MockClassLoader.java:219)
      2. org.powermock.core.classloader.MockClassLoader.loadModifiedClass(MockClassLoader.java:147)
      3. org.powermock.core.classloader.DeferSupportingClassLoader.loadClass(DeferSupportingClassLoader.java:67)
      3 frames
    3. Java RT
      Class.forName
      1. java.lang.ClassLoader.loadClass(ClassLoader.java:357)
      2. java.lang.Class.forName0(Native Method)
      3. java.lang.Class.forName(Class.java:340)
      3 frames
    4. powermock-module-junit4-common
      JUnit4TestSuiteChunkerImpl.createDelegatorFromClassloader
      1. org.powermock.modules.junit4.common.internal.impl.JUnit4TestSuiteChunkerImpl.createDelegatorFromClassloader(JUnit4TestSuiteChunkerImpl.java:132)
      2. org.powermock.modules.junit4.common.internal.impl.JUnit4TestSuiteChunkerImpl.createDelegatorFromClassloader(JUnit4TestSuiteChunkerImpl.java:39)
      2 frames
    5. powermock-core
      AbstractTestSuiteChunkerImpl.createTestDelegators
      1. org.powermock.tests.utils.impl.AbstractTestSuiteChunkerImpl.createTestDelegators(AbstractTestSuiteChunkerImpl.java:217)
      1 frame