1

I'm trying to update my project to Java 11 - OpenJDK_11.0.2 (currently on Java 8). I am using runjettyrun with Jetty version 9.4.8.v20171121.

I can run the project without any issues on Java 8, but if I switch to Java 11, I'll get the following error message:

MultiException[java.lang.RuntimeException: Error scanning file /Users/.../target/classes/.../entities/InventoryItemWithEnum.class, java.lang.RuntimeException: Error scanning file /Users/.../target/classes/.../entities/NeededItem.class, java.lang.RuntimeException: Error scanning file /Users/.../target/classes/.../entities/InventorySnapshot.class, java.lang.RuntimeException: Error scanning file /Users/.../target/classes/.../entities/InventoryItemAmount.class, java.lang.RuntimeException: Error scanning file /Users/.../target/classes/.../entities/TransferOrders.class, java.lang.RuntimeException: Error scanning file /Users/.../target/classes/.../entities/ItemSets.class, java.lang.RuntimeException: Error scanning file /Users/.../target/classes/.../entities/SearchSerialnumberView.class]
|   at org.eclipse.jetty.annotations.AnnotationParser.parseDir(AnnotationParser.java:717)
|   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)
|Suppressed: 
|   |java.lang.RuntimeException: Error scanning file /Users/.../target/classes/.../enumerations/Location.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.<init>(ClassReader.java:160)
|   |   at org.objectweb.asm.ClassReader.<init>(ClassReader.java:143)
|   |   at org.objectweb.asm.ClassReader.<init>(ClassReader.java:418)
|   |   at org.eclipse.jetty.annotations.AnnotationParser.scanClass(AnnotationParser.java:933)
|   |   at org.eclipse.jetty.annotations.AnnotationParser.parseDir(AnnotationParser.java:740)
|   |   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)
Naman
  • 27,789
  • 26
  • 218
  • 353
Yupp
  • 315
  • 3
  • 18
  • the underlying cause is an older version of `asm` to able to scan the newer classes – Naman Apr 26 '21 at 14:12
  • it's more than `asm`, it's also the older Jetty implementation that doesn't contain an update exclude list of content within the JAR to scan (for what Java 9 / JEP-238 bring to the table). – Joakim Erdfelt Apr 26 '21 at 18:22

1 Answers1

2

You must upgrade your version of Jetty.

9.4.9 was the first version to support Java 9.

Error scanning entry "module-info.class" when starting Jetty server

9.4.13 was the first version to support Java 11.

Spring : Migrating to OpenJDK-10 not working, mvn install is working

You want to be on 9.4.40, as versions below 9.4.39 are vulnerable in different ways.

https://www.eclipse.org/jetty/security_reports.php

Joakim Erdfelt
  • 46,896
  • 7
  • 86
  • 136