-
Notifications
You must be signed in to change notification settings - Fork 1.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Jetty logs warning with stacktrace when annotation parser encounters module-info.class file inside elasticsearch-x-content jar #9400
Comments
@d2a-pnagel while I take a look into this, have a read of https://www.eclipse.org/jetty/documentation/jetty-11/operations-guide/index.html#og-annotations If you know you've got everything defined in |
@janbartel thanks for the info. I will look into it. Issue seems to be resolved in the |
Indeed, the warning can be prevented when loading the The jetty context xml file increases configuration maintenance a bit, so adjusting the scanning code is still a nice solution. |
Fixed via #9433 |
Jetty version(s)
11.0.13
Java version/vendor
(use: java -version)
java version "18.0.1.1" 2022-04-22
Java(TM) SE Runtime Environment (build 18.0.1.1+2-6)
Java HotSpot(TM) 64-Bit Server VM (build 18.0.1.1+2-6, mixed mode, sharing)
OS type/version
Windows 11
Description
When Jetty loads a
.war
file which includes the elasticsearch, or more specifically, elasticsearch-x-content jar of version 8.2.0 and above, (4) warnings with stack traces are logged to the console by the annotation parser. Example:After some debugging (the logged
ClassInfo.toString
is not very helpful here), I discovered that the warning is about the following class files from the elasticsearch-x-content jar file:IMPL-JARS/x-content/es-jackson-core-8.6.1.jar/META-INF/versions/9/module-info.class
IMPL-JARS/x-content/jackson-dataformat-cbor-2.14.1.jar/META-INF/versions/9/module-info.class
IMPL-JARS/x-content/jackson-dataformat-smile-2.14.1.jar/META-INF/versions/9/module-info.class
IMPL-JARS/x-content/jackson-dataformat-yaml-2.14.1.jar/META-INF/versions/9/module-info.class
It seems to have been introduced by Elasticsearch in this PR: elastic/elasticsearch#83705 , introducing an embedded classloader. Since then, the
IMPL-JARS
directory withmodule-info.class
files is included in the elasticsearch-x-content jar file.Jetty issue #1692 / commit e81e17d addresses a similar issue, skipping
module-info.class
files on the root level of the jar file.A few suggestions/considerations:
module-info.class
in the scanned jar would effectively get rid of the warning.NullPointerException
) would make it more clear what the issue and its impact is.IMPL-JARS
directory, but not sure which criteria should be used for this (IMPL-JARS
is a name very specific for the elasticsearch-x-content jar file). Maybe Jetty can be configured to skip specific file patterns when scanning for annotations?How to reproduce?
Run
mvn jetty:run
in a directory with apom.xml
with content as below.Actual result:
Expected result:
The text was updated successfully, but these errors were encountered: