Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [jetty-dev] Jetty 10 with ALPN / H2 on the class path


On Mon, Jan 25, 2021 at 8:10 PM Eirik Bjørsnøs <eirbjo@xxxxxxxxx> wrote:
> Hello there,
> I'm trying to set up HTTP/2 with TLS in embedded Jetty 10, following this guide:
> ALPNServerConnectionFactory doesn't seem to work for me, since it scans for ALPN implementations using ServiceLoader and there is no plain old service declaration file in META-INF/services/*.
> JDK9ServerALPNProcessor is on my classpath but I'm not running Jetty on the module path, so no dice..

Ehm, what? The sentence above does not compute for me.

> For this use case, I'm embedding Jetty in a Java agent jar file, so loading it as a module is not exactly a trivial effort.

What module?

> 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.

> In any case, HpackFieldPreEncoder did actually have a META-INF/services entry, so by setting the TCCL, I was able to work around this issue and Jetty is now service H2 just fine!

What you say above seems to indicate that you did not have all the
required jars in the classpath.

> I had to change this to the following in order to get a successful negotiation of H2:
> new ServerConnector(server, tls, alpn, h2, http11)

Yes that's an inaccuracy.

Thanks for reporting this.

Simone Bordet
Developer advice, training, services and support
from the Jetty & CometD experts.

Back to the top