-
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
How to avoid duplicate class warnings? #3190
Comments
Jetty added the warning for duplicate scanned classes due to Issue #1819. Subsequent improvements to the warning have been made, most notably from Issue #2043 There has been no work for either of those issues in Jetty 9.3.x This warning tells you an important detail, you have duplicate classes in your running server / application! Why is this important? well, the biggest concern is that you have no guarantee of consistent behavior between runs. Only the first class encountered will be used by ClassLoader, so if you have version 2.0 and 3.0 in your ClassLoader, sometimes you'll get new functionality, sometimes you'll get old functionality. It's completely the luck of the draw. How do you avoid this being reported? If you are using |
Thank you very much! |
From the point of view of Java, that class exists in two places. Once from In the past (around 1998), this wasn't a big deal, but as webapps and the technology evolves (such as annotations and bytecode scanning), this becomes important to warn about and highlight in log warning messages. |
I'm closing this issue, as the solution is to ensure that each class is only on the classpath once. |
Hello. When I use jetty9.3.5, if there is servlet-api.jar in the project, then starting the jetty container will not report Warn :scanned from multiple locations: jar: . But when I use the jetty 9.4.14 version, starting jetty will report Warn:scanned from multiple locations: jar: . So, I would like to ask, is there a scan warning action in the Jetty 9.3.5 version, and then done in jetty 9.4.14? Or how can I avoid this warning not being reported in the Jetty 9.4.14 release? Thank you
The text was updated successfully, but these errors were encountered: