kumuluz / kumuluzee

Lightweight open-source framework for developing microservices using standard Java EE technologies and migrating Java EE to cloud-native architecture.
https://ee.kumuluz.com
MIT License
291 stars 71 forks source link

Java 11 support #125

Closed Mulgish closed 5 years ago

Mulgish commented 5 years ago

Can KumuluzEE be compiled into Java 11?

Regards, Juri

jmezna commented 5 years ago

Yes, you have to use KumuluzEE 3.0.0

Mulgish commented 5 years ago

kumuluzee-microProfile-1.2 has jetty 9.4.11 dependency which does not seem to support java 11. Java 11 support was introduced in 9.4.12 (https://www.eclipse.org/lists/jetty-announce/msg00124.html).

I am getting the below error when my server bytecode level is 11. There are no problems with java 10 or 9.

2018-11-13 14:08:22.196 WARNING -- org.eclipse.jetty.webapp.WebAppContext -- Failed startup of context o.e.j.w.WebAppContext@576f63f6{/,file:///C:/code/kumuluzeeRest/target/classes/webapp/,UNAVAILABLE} java.lang.RuntimeException: Error scanning file C:\code\kumuluzeeRest\target\classes\com\testjava11\kumuluzeeRest\boundary\rest\App.class at org.eclipse.jetty.annotations.AnnotationParser.parseDir(AnnotationParser.java:746) at org.eclipse.jetty.annotations.AnnotationParser.parse(AnnotationParser.java:832) at org.eclipse.jetty.annotations.AnnotationConfiguration$ParserTask.call(AnnotationConfiguration.java:161) at org.eclipse.jetty.annotations.AnnotationConfiguration$1.run(AnnotationConfiguration.java:468) at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:708) at org.eclipse.jetty.util.thread.QueuedThreadPool$2.run(QueuedThreadPool.java:626) at java.base/java.lang.Thread.run(Thread.java:834) Caused by: java.lang.IllegalArgumentException at org.objectweb.asm.ClassReader.(ClassReader.java:160) at org.objectweb.asm.ClassReader.(ClassReader.java:143) at org.objectweb.asm.ClassReader.(ClassReader.java:418) at org.eclipse.jetty.annotations.AnnotationParser.scanClass(AnnotationParser.java:933) at org.eclipse.jetty.annotations.AnnotationParser.parseDir(AnnotationParser.java:740) ... 6 more

ASM 6.2 support java 11 experimentally https://asm.ow2.io/versions.html.

My POM file has the following dependencies:

com.kumuluz.ee kumuluzee-bom 3.0.0 pom import
<dependencies>
    <dependency>
        <groupId>com.kumuluz.ee</groupId>
        <artifactId>kumuluzee-microProfile-1.2</artifactId>
    </dependency>

    <dependency>
        <groupId>org.apache.logging.log4j</groupId>
        <artifactId>log4j-api</artifactId>
        <version>${log4j.version}</version>
    </dependency>
    <dependency>
        <groupId>org.apache.logging.log4j</groupId>
        <artifactId>log4j-core</artifactId>
        <version>${log4j.version}</version>
    </dependency>

    <dependency>
        <groupId>com.google.guava</groupId>
        <artifactId>guava</artifactId>
        <version>25.1-jre</version>
    </dependency>
urbim commented 5 years ago

This issue is caused by dependencies in MicroProfile 1.2. While KumuluzEE 3.0.0 and its components are Java 9+ compatible, not all extensions have been adjusted for Java 9 changes.

We are in the process of adjusting extensions for Java 9+, but until then, you can use KumuluzEE 3.0.0 with extensions on Java 1.8 or KumuluzEE 3.0.0 with only components and currently supported extensions on Java 11.