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
Prevent compilation-time jetty log initialization #468
Comments
Thanks for the report. A PR to fix this would be welcome. |
I found that I can use One fix that I can think of is to split the namespace so that the imports would be located in two separate namespaces and the builder methods would be separated as well. One alternative to it would be to dynamically load the class by its title when the In any way the There could also be a hybrid approach where we would still have two namespaces but we would load the I don't want to remove the functionality because somebody may depend on it (it would be unfortunate if suddenly somebody would find out that their webpage is HTTP-only because some kind of scanner didn't load). Edit: I thought that |
I think supporting GraalVM is a good idea, but if we want to make the support official it'll need tests to prevent regressions from classes like this. I'm fine with lazy loading the offending piece of code, with an eye to looking to add some GraalVM tests in future to prevent this sort of thing from happening in future. |
My chat with @borkdude showed that I have no idea where the bug is. I tried to create a minimum repro and I think I can't find it. I'll try to import more things. |
I tried with my minimal repro and when I add |
Thanks for the investigation and verifying it works with 1.9.1. I hope you find the cause of your issue. |
The commit cb28ec5 introcuces a new import of
KeyStoreScanner
into the namespace. That class hasLOG
instance which can be seen here: https://github.com/eclipse/jetty.project/blob/cb127793e5d8b5c5730b964392a9a905ba49191d/jetty-util/src/main/java/org/eclipse/jetty/util/ssl/KeyStoreScanner.java#L39This log instance is initialized at build time and this message is printed when I run
ring uberjar
on my Clojure app:The timestamp
15339ms
is the time since the JVM has started and doesn't say much but what it does it initialize the logging at build time.And this logging initialization prevents me from running graalvm's
native-image
command because this message appears:That means that by requring namespace
ring.adapter.jetty
in any way (I tried to requirerun-jetty
and:as
but it still loads that class which I don't use at all (because my SSL is managed by my cloud provider)) I can't build graalvm executable.My version:
[ring/ring-jetty-adapter "1.9.5"]
The text was updated successfully, but these errors were encountered: