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


This seems to also be ServiceLoader related, this time I guess its HpackFieldPreEncoder not being found.

PreEncodedHttpField seems to use ServiceLoader without specifying a ClassLoader, so ServiceLoader uses the Thread's CCL.

Would perhaps be better to use the class loader which Jetty was loaded with?

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!

(Yes, I'm loading Jetty from a custom classloader, not the app classloader).

I'm guessing the missing ALPN META-INF/services entry is an oversight which can be easily fixed?


On Mon, Jan 25, 2021 at 8:22 PM Eirik Bjørsnøs <eirbjo@xxxxxxxxx> wrote:

Looking a bit closer at the logs (lots of it with DEBUG enabled :), I noticed the following earlier in the HTTP/2 conversation:

[qtp1612799726-17] DEBUG org.eclipse.jetty.http2.hpack.HpackEncoder - encode IdxFieldS1:':status: 200' to '88'
[qtp1612799726-17] DEBUG org.eclipse.jetty.http2.HTTP2Flusher - Failure generating HeadersFrame@11e995ab#1{end=false}
org.eclipse.jetty.http2.hpack.HpackException$SessionException: Could not hpack encode HTTP/2.0{s=200,h=2,cl=268}
at org.eclipse.jetty.http2.hpack.HpackEncoder.encode(
at org.eclipse.jetty.http2.generator.FrameGenerator.encode(
at org.eclipse.jetty.http2.generator.HeadersGenerator.generateHeaders(
at org.eclipse.jetty.http2.generator.HeadersGenerator.generate(
at org.eclipse.jetty.http2.generator.Generator.control(
at org.eclipse.jetty.http2.HTTP2Session$ControlEntry.generate(
at org.eclipse.jetty.http2.HTTP2Flusher.process(
at org.eclipse.jetty.util.IteratingCallback.processing(
at org.eclipse.jetty.util.IteratingCallback.iterate(
at org.eclipse.jetty.http2.HTTP2Session.frame(
at org.eclipse.jetty.http2.HTTP2Session.frames(
at org.eclipse.jetty.http2.HTTP2Stream.send(
at org.eclipse.jetty.http2.server.HttpTransportOverHTTP2.lambda$sendHeaders$0(
at org.eclipse.jetty.http2.server.HttpTransportOverHTTP2$TransportCallback.send(
at org.eclipse.jetty.http2.server.HttpTransportOverHTTP2.sendHeaders(HttpTransportOv


Back to the top