Upgrade to Java 8 causes Orika mapper in unittest java.io.IOException: invalid constant type: 15 at 142

后端 未结 1 1824
醉梦人生
醉梦人生 2021-01-19 07:44

I have a project that I want to update the version from Java 1.7 to Java 1.8 but running the UnitTests all mapper tests are failing.

The project is using: SpringJUni

相关标签:
1条回答
  • 2021-01-19 08:07

    Your idea goes into the right direction.

    the java.lang.RuntimeException: java.io.IOException: invalid constant type: 15 at 142 shows that the the application has problems with java 8 - as explained inn your link.

    The ma.glasnost.orika mapper depends on javassist as you can see in the Stack Trace. This is a transitive dependency of orika.

    You could use mvn dependency:tree -verbose to build a dependency tree. There you can look up the what library is depending eg on javassist and the exact version.

    To use a javassist version that is Java 8 compatible use that dependency to overwrite the implicit dependency of orika:

      <dependency>
        <groupId>org.javassist</groupId>
        <artifactId>javassist</artifactId>
        <version>3.18.2-GA</version>
      </dependency>
    

    But for this example it might by better to upgrade the orika version to 1.4.6 as this one is Java 8 ready.

    0 讨论(0)
提交回复
热议问题