You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Question
First, let me explain what I am doing. I have created a maven repository to do
some http related tests and I am using jetty for an http2 server. I am using
JUnit 5 for the unit tests. The tests runs successfully under maven. No errors.
For the next step, I would like to run the tests on another machine.
Configuring maven on that machine to obtaining dependencies is a bit of
a hassle, so I thought I could use the JUnit Console Launcher
(https://junit.org/junit5/docs/current/user-guide/#running-tests-console-launcher).
So I package the test jar with dependencies of the maven project and run the
following command with both the junit console launcher jar and my test jar like
the following:
And I have observed the following stack trace in my test.
[qtp1432569632-28] DEBUG org.eclipse.jetty.http2.HTTP2Flusher - Failure generating HeadersFrame@46477305#1[end=false,{HTTP/2.0{s=200,h=12,cl=-1}},priority=null]
org.eclipse.jetty.http2.hpack.HpackException$SessionException: Could not hpack encode HTTP/2.0{s=200,h=12,cl=-1}
at org.eclipse.jetty.http2.hpack.HpackEncoder.encode(HpackEncoder.java:278)
at org.eclipse.jetty.http2.generator.FrameGenerator.encode(FrameGenerator.java:56)
at org.eclipse.jetty.http2.generator.HeadersGenerator.generateHeaders(HeadersGenerator.java:65)
at org.eclipse.jetty.http2.generator.HeadersGenerator.generate(HeadersGenerator.java:52)
at org.eclipse.jetty.http2.generator.Generator.control(Generator.java:86)
at org.eclipse.jetty.http2.HTTP2Session$ControlEntry.generate(HTTP2Session.java:1245)
at org.eclipse.jetty.http2.HTTP2Flusher.process(HTTP2Flusher.java:215)
...
Caused by: java.lang.ArrayIndexOutOfBoundsException: Index 1 out of bounds for length 1
at org.eclipse.jetty.http.PreEncodedHttpField.putTo(PreEncodedHttpField.java:121)
at org.eclipse.jetty.http2.hpack.HpackEncoder.encode(HpackEncoder.java:377)
at org.eclipse.jetty.http2.hpack.HpackEncoder.encode(HpackEncoder.java:249)
... 50 more
I did a bit googling and find there are related tickets (e.g., #9168) which points to the
HpackFieldEncoder class not being loaded.
Debugging it myself, I can confirm that my test jar contains the class. When
I explicitly does ServiceLoader.load(HttpFieldPreEncoder.class) before the
test, it does not help. I also tried to add -Dorg.eclipse.jetty.http.PreEncodedHttpField.LEVEL=DEBUG to see if the class
is loaded as is suggested by one of those related tickets, but I did not see
anything related.
Please advise what I should do to fix or debug this issue. Thanks a lot.
The text was updated successfully, but these errors were encountered:
Jetty version
11.0.15
Java version
11
Question
First, let me explain what I am doing. I have created a maven repository to do
some http related tests and I am using jetty for an http2 server. I am using
JUnit 5 for the unit tests. The tests runs successfully under maven. No errors.
For the next step, I would like to run the tests on another machine.
Configuring maven on that machine to obtaining dependencies is a bit of
a hassle, so I thought I could use the JUnit Console Launcher
(https://junit.org/junit5/docs/current/user-guide/#running-tests-console-launcher).
So I package the test jar with dependencies of the maven project and run the
following command with both the junit console launcher jar and my test jar like
the following:
And I have observed the following stack trace in my test.
I did a bit googling and find there are related tickets (e.g.,
#9168) which points to the
HpackFieldEncoder class not being loaded.
Debugging it myself, I can confirm that my test jar contains the class. When
I explicitly does
ServiceLoader.load(HttpFieldPreEncoder.class)
before thetest, it does not help. I also tried to add
-Dorg.eclipse.jetty.http.PreEncodedHttpField.LEVEL=DEBUG
to see if the classis loaded as is suggested by one of those related tickets, but I did not see
anything related.
Please advise what I should do to fix or debug this issue. Thanks a lot.
The text was updated successfully, but these errors were encountered: