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

前端 未结 1 980
余生分开走
余生分开走 2020-12-03 21:13

I\'m seeing this recently when I start my java server. Has anyone else seen this? If so whats the fix? I can confirm the jar\'s and the module-info.class are present in the

相关标签:
1条回答
  • 2020-12-03 21:43

    module-info.class is a Java9 (JPMS) feature.

    Jetty 9.4.9 (or newer) supports the new JAR file changes from Java 9.

    It does not matter what Runtime JVM you are using (Oracle Java 8, or even something like OpenJDK 11.0.3), if you are using those JEP-238 Multi-Release Jar files in your WebApp (or Server classloader) then you are required to upgrade your Jetty version to Jetty 9.4.x.

    This is because of the bytecode scanning requirement that Servlet 3.x introduces. Jetty is required to scan all JAR files for possible servlet annotations or references that match your webapp defined @HandlesTypes. Once JEP-238 became a reality, this bytecode scanning layer had to be adapted/updated/fixed to support these new JAR file structures. Jetty 9.4.9 was the first version of Jetty to support these new JAR file structures during bytecode scanning.

    Issues about Java 9 features:

    • https://github.com/eclipse/jetty.project/issues/1692 - excluding module-info.class from bytecode scanning.
    • https://github.com/eclipse/jetty.project/issues/1797 - supporting META-INF/versions/* Multi-Release JAR files (JEP 238) properly.
    0 讨论(0)
提交回复
热议问题