> Was this intentional? It kind of means Jetty 10 cannot be used with ALPN on the classpath?
Jetty 10 can be used with ALPN on the classpath.
Our website runs in this way.
What you say above seems to indicate that you did not have all the
required jars in the classpath.
Yes, I had the classes on the classpath, but ServiceLoader.load(Server.class) looks in the current Thread's context classloader. I was loading Jetty in a custom URLClassLoader without setting the Thread context classloader.
Turns out I was blind and didn't find the META-INF/services record for JDK9ServerALPNProcessor. (Sorry for the noise!)
When setting the TCCL before starting Jetty, everything now works and I can remove my custom ALPNServerConnectionFactory.
I see three options that the Jetty team might consider:
1: Do nothing (loading from custom classloaders might not be a very common use case)
2: Adjust Jetty's use of ServiceLoader to specify the classloader which Jetty was loaded in when loading services.
3: Document that the TCCL should be set in such use cases.
Thanks,
Eirik.