Skip to content
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

[hpack] HpackException$SessionException when encoding client PUT request #9168

Closed
andrewfg opened this issue Jan 13, 2023 · 26 comments
Closed
Labels
Bug For general bugs on Jetty side End-of-Life release

Comments

@andrewfg
Copy link

Issue

In my Java client application, when I send a client HTTP/2.0 PUT request, it throws an 'HpackException$SessionException' as shown in Error Log below; by contrast it succeeds when I send the exact same client HTTP/2.0 request, but with GET instead of PUT, as shown in Success Log below.

I guess this is because PUT is not in the static lookup table, whereas GET is so. ??

Windows 10, Java 17.0.5, OpenHab 4.0.0, Jetty 9.4.46.v20220331

Error Log

2023-01-13 13:16:35.534 [TRACE] [.hue.internal.connection.Clip2Bridge] - PUT https://192.168.1.108/clip/v2/resource/light/ba38af49-4206-47fb-b05a-b54887c12b4c HTTP/2.0 >> {"type":"light","id":"ba38af49-4206-47fb-b05a-b54887c12b4c","on":{"on":true}}
2023-01-13 13:16:35.534 [DEBUG] [org.eclipse.jetty.http2.HTTP2Session] - Creating stream #249 for HTTP2ClientSession@63ac1579{local:/192.168.1.38:60390,remote:/192.168.1.108:443,sendWindow=2147483647,recvWindow=16668891,state=[streams=1,NOT_CLOSED,goAwayRecv=null,goAwaySent=null,failure=null]}
2023-01-13 13:16:35.535 [DEBUG] [org.eclipse.jetty.http2.HTTP2Session] - Created local HTTP2Stream@3ebf948a#249@63ac1579{sendWindow=65536,recvWindow=8388608,reset=false/false,NOT_CLOSED,age=0,attachment=null} for HTTP2ClientSession@63ac1579{local:/192.168.1.38:60390,remote:/192.168.1.108:443,sendWindow=2147483647,recvWindow=16668891,state=[streams=2,NOT_CLOSED,goAwayRecv=null,goAwaySent=null,failure=null]}
2023-01-13 13:16:35.536 [DEBUG] [org.eclipse.jetty.http2.HTTP2Flusher] - Appended [HeadersFrame@3270ba86#249{end=false}], entries=1
2023-01-13 13:16:35.536 [DEBUG] [org.eclipse.jetty.http2.HTTP2Flusher] - Flushing HTTP2ClientSession@63ac1579{local:/192.168.1.38:60390,remote:/192.168.1.108:443,sendWindow=2147483647,recvWindow=16668891,state=[streams=2,NOT_CLOSED,goAwayRecv=null,goAwaySent=null,failure=null]}
2023-01-13 13:16:35.537 [DEBUG] [org.eclipse.jetty.http2.HTTP2Flusher] - Processing HeadersFrame@3270ba86#249{end=false}
2023-01-13 13:16:35.537 [DEBUG] [lipse.jetty.http2.hpack.HpackEncoder] - CtxTbl[7bac4b1e] encoding
2023-01-13 13:16:35.538 [DEBUG] [org.eclipse.jetty.http2.HTTP2Flusher] - Failure generating HeadersFrame@3270ba86#249{end=false}
org.eclipse.jetty.http2.hpack.HpackException$SessionException: Could not hpack encode PUT{u=https://192.168.1.108/clip/v2/resource/light/ba38af49-4206-47fb-b05a-b54887c12b4c,HTTP/2.0,h=5,cl=77}
	at org.eclipse.jetty.http2.hpack.HpackEncoder.encode(HpackEncoder.java:275) ~[bundleFile:9.4.46.v20220331]
	at org.eclipse.jetty.http2.generator.FrameGenerator.encode(FrameGenerator.java:56) ~[bundleFile:9.4.46.v20220331]
	at org.eclipse.jetty.http2.generator.HeadersGenerator.generateHeaders(HeadersGenerator.java:70) ~[bundleFile:9.4.46.v20220331]
	at org.eclipse.jetty.http2.generator.HeadersGenerator.generate(HeadersGenerator.java:57) ~[bundleFile:9.4.46.v20220331]
	at org.eclipse.jetty.http2.generator.Generator.control(Generator.java:86) ~[bundleFile:9.4.46.v20220331]
	at org.eclipse.jetty.http2.HTTP2Session$ControlEntry.generate(HTTP2Session.java:1170) ~[bundleFile:9.4.46.v20220331]
	at org.eclipse.jetty.http2.HTTP2Flusher.process(HTTP2Flusher.java:218) [bundleFile:9.4.46.v20220331]
	at org.eclipse.jetty.util.IteratingCallback.processing(IteratingCallback.java:241) [bundleFile:9.4.46.v20220331]
	at org.eclipse.jetty.util.IteratingCallback.iterate(IteratingCallback.java:223) [bundleFile:9.4.46.v20220331]
	at org.eclipse.jetty.http2.HTTP2Session$StreamsState.flush(HTTP2Session.java:2187) [bundleFile:9.4.46.v20220331]
	at org.eclipse.jetty.http2.HTTP2Session$StreamsState.createLocalStream(HTTP2Session.java:2104) [bundleFile:9.4.46.v20220331]
	at org.eclipse.jetty.http2.HTTP2Session$StreamsState.newLocalStream(HTTP2Session.java:2031) [bundleFile:9.4.46.v20220331]
	at org.eclipse.jetty.http2.HTTP2Session$StreamsState.access$600(HTTP2Session.java:1436) [bundleFile:9.4.46.v20220331]
	at org.eclipse.jetty.http2.HTTP2Session.newStream(HTTP2Session.java:578) [bundleFile:9.4.46.v20220331]
	at org.eclipse.jetty.http2.HTTP2Session.newStream(HTTP2Session.java:572) [bundleFile:9.4.46.v20220331]
	at org.openhab.binding.hue.internal.connection.Clip2Bridge.putResource2Impl2(Clip2Bridge.java:859) [bundleFile:?]
	at org.openhab.binding.hue.internal.connection.Clip2Bridge.putResource(Clip2Bridge.java:811) [bundleFile:?]
	at org.openhab.binding.hue.internal.handler.Clip2BridgeHandler.putResource(Clip2BridgeHandler.java:467) [bundleFile:?]
	at org.openhab.binding.hue.internal.handler.DeviceThingHandler.handleCommand(DeviceThingHandler.java:186) [bundleFile:?]
	at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:?]
	at jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77) ~[?:?]
	at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:?]
	at java.lang.reflect.Method.invoke(Method.java:568) ~[?:?]
	at org.openhab.core.internal.common.AbstractInvocationHandler.invokeDirect(AbstractInvocationHandler.java:154) [bundleFile:?]
	at org.openhab.core.internal.common.InvocationHandlerSync.invoke(InvocationHandlerSync.java:59) [bundleFile:?]
	at jdk.proxy124.$Proxy225.handleCommand(Unknown Source) [?:?]
	at org.openhab.core.thing.internal.profiles.ProfileCallbackImpl.handleCommand(ProfileCallbackImpl.java:85) [bundleFile:?]
	at org.openhab.core.thing.internal.profiles.SystemDefaultProfile.onCommandFromItem(SystemDefaultProfile.java:48) [bundleFile:?]
	at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:?]
	at jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77) ~[?:?]
	at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:?]
	at java.lang.reflect.Method.invoke(Method.java:568) ~[?:?]
	at org.openhab.core.internal.common.AbstractInvocationHandler.invokeDirect(AbstractInvocationHandler.java:154) [bundleFile:?]
	at org.openhab.core.internal.common.Invocation.call(Invocation.java:52) [bundleFile:?]
	at java.util.concurrent.FutureTask.run(FutureTask.java:264) [?:?]
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136) [?:?]
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635) [?:?]
	at java.lang.Thread.run(Thread.java:833) [?:?]
Caused by: java.lang.ArrayIndexOutOfBoundsException: Index 1 out of bounds for length 1
	at org.eclipse.jetty.http.PreEncodedHttpField.putTo(PreEncodedHttpField.java:118) ~[bundleFile:9.4.46.v20220331]
	at org.eclipse.jetty.http2.hpack.HpackEncoder.encode(HpackEncoder.java:376) ~[bundleFile:9.4.46.v20220331]
	at org.eclipse.jetty.http2.hpack.HpackEncoder.encode(HpackEncoder.java:203) ~[bundleFile:9.4.46.v20220331]
	... 37 more

Success Log

2023-01-13 13:21:46.145 [TRACE] [.hue.internal.connection.Clip2Bridge] - GET https://192.168.1.108/clip/v2/resource/light/ba38af49-4206-47fb-b05a-b54887c12b4c HTTP/2.0 >> {"type":"light","id":"ba38af49-4206-47fb-b05a-b54887c12b4c","on":{"on":true}}
2023-01-13 13:21:46.145 [DEBUG] [org.eclipse.jetty.http2.HTTP2Session] - Creating stream #247 for HTTP2ClientSession@2888557a{local:/192.168.1.38:60453,remote:/192.168.1.108:443,sendWindow=2147483647,recvWindow=16692538,state=[streams=1,NOT_CLOSED,goAwayRecv=null,goAwaySent=null,failure=null]}
2023-01-13 13:21:46.145 [DEBUG] [org.eclipse.jetty.http2.HTTP2Session] - Created local HTTP2Stream@7a28955e#247@2888557a{sendWindow=65536,recvWindow=8388608,reset=false/false,NOT_CLOSED,age=0,attachment=null} for HTTP2ClientSession@2888557a{local:/192.168.1.38:60453,remote:/192.168.1.108:443,sendWindow=2147483647,recvWindow=16692538,state=[streams=2,NOT_CLOSED,goAwayRecv=null,goAwaySent=null,failure=null]}
2023-01-13 13:21:46.146 [DEBUG] [org.eclipse.jetty.http2.HTTP2Flusher] - Appended [HeadersFrame@5c61fabb#247{end=false}], entries=1
2023-01-13 13:21:46.146 [DEBUG] [org.eclipse.jetty.http2.HTTP2Flusher] - Flushing HTTP2ClientSession@2888557a{local:/192.168.1.38:60453,remote:/192.168.1.108:443,sendWindow=2147483647,recvWindow=16692538,state=[streams=2,NOT_CLOSED,goAwayRecv=null,goAwaySent=null,failure=null]}
2023-01-13 13:21:46.146 [DEBUG] [org.eclipse.jetty.http2.HTTP2Flusher] - Processing HeadersFrame@5c61fabb#247{end=false}
2023-01-13 13:21:46.146 [DEBUG] [lipse.jetty.http2.hpack.HpackEncoder] - CtxTbl[3139673] encoding
2023-01-13 13:21:46.147 [DEBUG] [lipse.jetty.http2.hpack.HpackEncoder] - encode IdxFieldS1:':scheme: https' to '87'
2023-01-13 13:21:46.147 [DEBUG] [lipse.jetty.http2.hpack.HpackEncoder] - encode IdxFieldS1:':method: GET' to '82'
2023-01-13 13:21:46.147 [DEBUG] [lipse.jetty.http2.hpack.HpackEncoder] - encode IdxField1:':authority: 192.168.1.108' to 'C9'
2023-01-13 13:21:46.147 [DEBUG] [lipse.jetty.http2.hpack.HpackContext] - HdrTbl[3139673] added {D,51,:path: /clip/v2/resource/light/ba38af49-4206-47fb-b05a-b54887c12b4c,4b18a8e5}
2023-01-13 13:21:46.147 [DEBUG] [lipse.jetty.http2.hpack.HpackContext] - HdrTbl[3139673] evict {D,10,:path: /clip/v2/resource/zigbee_connectivity/49d03c43-75ef-415b-88d0-264e6c2ea748,4abaaac9}
2023-01-13 13:21:46.147 [DEBUG] [lipse.jetty.http2.hpack.HpackContext] - HdrTbl[3139673] entries=41, size=4053, max=4096
2023-01-13 13:21:46.147 [DEBUG] [lipse.jetty.http2.hpack.HpackEncoder] - encode LitIdxNS1HuffVIdx:':path: /clip/v2/resource/light/ba38af49-4206-47fb-b05a-b54887c12b4c' to '44Ab60941aB63b898b0a83Db610aC5069a74B118D97872B4FaCd080e2cD3B2C6B4606c6b46Db4f3cE90228Da27'
2023-01-13 13:21:46.147 [DEBUG] [lipse.jetty.http2.hpack.HpackEncoder] - encode IdxField1:'Accept: application/json' to 'C5'
2023-01-13 13:21:46.147 [DEBUG] [lipse.jetty.http2.hpack.HpackEncoder] - encode IdxField1:'User-Agent: org-openhab-binding-hue-clip2' to 'C8'
2023-01-13 13:21:46.147 [DEBUG] [lipse.jetty.http2.hpack.HpackEncoder] - encode IdxField1:'hue-application-key: JP1Qt5N5E6EivPdFSlyKSTV8RugSA0VTdDja0kXU' to 'C7'
2023-01-13 13:21:46.147 [DEBUG] [lipse.jetty.http2.hpack.HpackContext] - HdrTbl[3139673] added {D,52,Content-Type: application/json,24bb99bd}
2023-01-13 13:21:46.147 [DEBUG] [lipse.jetty.http2.hpack.HpackContext] - HdrTbl[3139673] evict {D,11,:path: /clip/v2/resource/button/14debc09-496e-4429-8c22-4975c135bbdf,3968eae1}
2023-01-13 13:21:46.148 [DEBUG] [lipse.jetty.http2.hpack.HpackContext] - HdrTbl[3139673] entries=41, size=4015, max=4096
2023-01-13 13:21:46.148 [DEBUG] [lipse.jetty.http2.hpack.HpackEncoder] - encode LitIdxNS1HuffVIdx:'Content-Type: application/json' to '5f8b1d75D0620d263d4c7441Ea'
2023-01-13 13:21:46.148 [DEBUG] [lipse.jetty.http2.hpack.HpackEncoder] - encode LitIdxNS2HuffV!Idx:'Content-Length: 77' to '0f0d8275Df'
2023-01-13 13:21:46.148 [DEBUG] [lipse.jetty.http2.hpack.HpackEncoder] - CtxTbl[3139673] encoded 69 octets
...
@andrewfg andrewfg added the Bug For general bugs on Jetty side label Jan 13, 2023
@sbordet
Copy link
Contributor

sbordet commented Jan 13, 2023

Jetty 9.x is now at End of Community Support.

Please try Jetty 10/11.

@sbordet
Copy link
Contributor

sbordet commented Jan 13, 2023

Caused by: java.lang.ArrayIndexOutOfBoundsException: Index 1 out of bounds for length 1

You have a classpath mistake, likely not including the right jars.

@andrewfg
Copy link
Author

andrewfg commented Jan 13, 2023

@sbordet many thanks for the quick responses.

Please try Jetty 10/11.

I wanted to try that already, but since the OpenHab core developers have not yet adopted Jetty 10, I am constrained to remain on 9.4.x for the time being. Sorry for that..

a classpath mistake, likely not including the right jars

Ah-Ha, but could you kindly be more explicit?
I declare the primary dependency in my pom as follows..

<dependency>
<groupId>org.eclipse.jetty.http2</groupId>
<artifactId>http2-client</artifactId>
<version>9.4.46.v20220331</version>
</dependency>

And I have the following JARs loaded..

2022-12-18  11:19           206'156 http2-common-9.4.46.v20220331.jar
2022-12-18  11:20            52'146 http2-hpack-9.4.46.v20220331.jar
2022-12-18  11:25            16'520 jetty-alpn-client-9.4.46.v20220331.jar
2022-12-18  11:59            16'957 jetty-alpn-java-client-9.4.46.v20220331.jar

@joakime
Copy link
Contributor

joakime commented Jan 13, 2023

Similar error reported at Issue #7964 (also on Jetty 9.x)

@joakime
Copy link
Contributor

joakime commented Jan 13, 2023

Opened openhab/openhab-core#3315

@andrewfg
Copy link
Author

@joakime many thanks for your feedback.

@J-N-K given our discussion HERE I wonder if you can comment about why the OH binding OSGI loader may not be loading the required Jetty JARS?

@sbordet
Copy link
Contributor

sbordet commented Jan 21, 2023

@andrewfg Jetty loads HttpFieldPreEncoder implementations via the ServiceLoader mechanism.

The implementation for HTTP/1.1 is provided in jetty-http-<version>.jar.
The implementation for HTTP/2 is provided in http2-hpack-<version>.jar.

The stack trace shows that you are using HTTP/2, so the HTTP/2 HttpFieldPreEncoder should have been loaded already, but it was not.

In the manifest for http2-hpack-<version>.jar we have:

Provide-Capability: osgi.serviceloader;osgi.serviceloader="org.eclipse.j
 etty.http.HttpFieldPreEncoder"
Require-Capability: osgi.extender;filter:="(osgi.extender=osgi.servicelo
 ader.registrar)";resolution:=optional

So I think we do the right incantation for OSGi to work.

I don't think this is a Jetty issue, so the ball is in your court now.

@andrewfg
Copy link
Author

the ball is in your court now.

@sbordet many thanks. I am not an expert on OSGI module loading, so I rely on the OpenHab core system maintainers to provide the necessary infrastructure to my case. Therefore I wonder if, from your experience, you can give me any tips about what specifically I should ask those guys to do, to ensure that the hpack module gets loaded?

@sbordet
Copy link
Contributor

sbordet commented Jan 21, 2023

@andrewfg there could be many reasons, from wrong usage of the thread context ClassLoader, to re-packaging of Jetty jars gone wrong, etc.

@andrewfg
Copy link
Author

@sbordet I am so sorry to be a PITA but I am still confused; the OH system runs on Karaf where the bundle:list command shows the Jetty bundles loaded and active (see below); so it is not obvious to me that there is anything actually missing?

image

@joakime
Copy link
Contributor

joakime commented Jan 24, 2023

Reminder, Jetty 9.x is at End of Community Support.

Once OpenHAB has upgraded to Jetty 10, and if you have the same problem, we can continue to support you.

@sbordet
Copy link
Contributor

sbordet commented Jan 26, 2023

@andrewfg sorry, but this seems like an OSGi issue, not a Jetty one.
Perhaps HTTP/2 is loaded too late, so the system starts without the HTTP/2 HttpFieldPreEncoder and there is no mechanism to add it later.

And what @joakime said above.

@andrewfg
Copy link
Author

@sbordet I do really appreciate you taking the extra time to help me out :) .. and I do also understand @joakime 's insistence on keeping good order .. so I thank you all the more :)

the system is starts without the HTTP/2 HttpFieldPreEncoder and there is no mechanism to add it later.

@sbordet yes I think that is indeed the case: I tried putting an SPI manifest file (below) in my addon JAR, and I can confirm that if I call ServiceLoader.load(HttpFieldPreEncoder.class) from my code, then both HTTP/1.0 and HTTP/2.0 encoders are indeed loaded; but nevertheless the application code still fails with the same 'Index 1 out of bounds for length 1' as in my OP above; so indeed I assume that Jetty was indeed initialised too early.

PS and in that case, I am not so sure if migrating from 9.4.x to 10.x or 11.x would actually solve the issue.. (??)

manifest file: org.eclipse.jetty.http.HttpFieldPreEncoder

org.eclipse.jetty.http.Http1FieldPreEncoder
org.eclipse.jetty.http2.hpack.HpackFieldPreEncoder

@sbordet
Copy link
Contributor

sbordet commented Jan 26, 2023

@andrewfg so if that is the case, then it's not Jetty.

You have to configure whatever OSGi container you're running on -- this is outside the scope of Jetty, sorry.

Try to figure out who's the first to trigger the load via the ServiceLoader first, and make sure HTTP/2 jars are already deployed by that time is all I can suggest (you won't like the other suggestion 😏)

@andrewfg
Copy link
Author

it's not Jetty.

Ummm..

figure out who's the first to trigger the load via the ServiceLoader first, and make sure HTTP/2 jars are already deployed by that time

.. maybe Jetty is the culprit after all? Background: the OpenHAB core has built in dependencies on Jetty HTTP/1.0 Jars which are loaded when the OH core starts up. And once the core is running, it starts to Osgi load various third party addons ('bindings') such as mine. And my binding declares dependencies on Jetty HTTP/2.0 Jars, which are are probably therefore loaded last of all. So I think the ServiceLoader call is made -- dare I say it, by Jetty HTTP/1.0 (code below) -- well before the HTTP/2.0 Jars will have been loaded. Or something like that..

image

@joakime
Copy link
Contributor

joakime commented Jan 26, 2023

You are using Jetty 9.x, which is at End of Community Support.
You should not be using Jetty 9.x anymore.

That's standard java.util.ServiceLoader usage for Java 8 (and older).

That same code in Jetty 10 looks like this ...

https://github.com/eclipse/jetty.project/blob/beee5ffff0d968da73332f21f15fbffc58db6b3c/jetty-http/src/main/java/org/eclipse/jetty/http/PreEncodedHttpField.java#L42-L54

Which uses the new java.util.ServiceLoader.stream() support introduced in Java 9 (released in 2017)

Other OSGi users of Jetty 9+ (both Eclipse Equinox and Apache Felix) successfully use HTTP/2 without the issues you are experiencing.
The problem is not in Jetty, it's in your environment.

You need to figure this out, as ServiceLoader usage has exploded across the board over the years.
Nearly all Jakarta EE spec API jars have 1 (or more) ServiceLoader usages now as well.

@andrewfg
Copy link
Author

@joakime many thanks for your response. The code that you quote in 10.x also has a class static method that loads a class static final field using a ServiceLoader. So in other words, even if I would be using 10.x, I would still have an issue if the application loads the HTTP/2.0 Jars at some time after it has already loaded the HTTP/1.0 jars and thus instatiated that classes static final field. This looks very much to me like a bug on your side. You should probably not have static final fields being initialised by class static methods, but rather should do the initialization when the class is actually instantiated.

@sbordet
Copy link
Contributor

sbordet commented Jan 26, 2023

This looks very much to me like a bug on your side

Except it's not.
There are no issues whatsoever for those using the normal class-path, or module-path, or other OSGi environments.
We have tests for all those combinations in our test suite, and they all pass.

What remains is something peculiar to your configuration, not to Jetty.

@joakime
Copy link
Contributor

joakime commented Jan 26, 2023

Doesn't matter.

JPMS and OSGi have the same rules.
Don't access / instantiate the classes until you have added/loaded all of the necessary dependencies.
You cannot add/load dependencies later and expect things to work reliably on any core component.

This is not unique to Jetty.
This applies to hundreds of ServiceLoader usages across all of the dependencies you have currently.
You are focusing on one use case, when there are countless more that do exactly the same thing.
Few projects will repeatedly use ServiceLoader, as it's an expensive operation.
The overwhelming majority of use cases do exactly the same thing we do, put the results in a static final field once, and continue to use it over and over again.

Your problem isn't even unique to ServiceLoader, this kind of late introduction of dependencies would cause issues and bugs to countless other Pool and/or Cache implementations and usages as well.
Don't instantiate/use any classes until you have the entire set of dependencies necessary available.

@andrewfg
Copy link
Author

andrewfg commented Jan 26, 2023

^
Nice argument. But it simply does not work in an application architecture which comprises a core, plus addons that are loaded dynamically later.

I may try to hack a solution using reflection, but I don't know if reflection allows accessing of static final fields.. Otherwise, I guess that I shall have to ditch Jetty and use some other library.

@joakime
Copy link
Contributor

joakime commented Jan 27, 2023

You'll have the same problem with JDK classes as well. (security, inetaddress resolvers, filesystems, filesystemproviders, cipher suites, etc. At last count there are over 400 such use cases in Java 11, where a ServiceLoader lookup happens once and the values are cached/stored on a static / constant / pool / singleton / etc).
So make your solution generic enough to work with those too.

@joakime
Copy link
Contributor

joakime commented Jan 27, 2023

It most certainly works with a core + addons added later, that's what Eclipse RT does with Jetty right now.
RT Core has Jetty. (mostly used for the help system, but also to provide generic http services too)
Various RT plugins use Jetty classes to initiate HTTP/2 requests to outside services (those plugins also use PreEncodedHttpField from the jetty-http package)

@andrewfg
Copy link
Author

It most certainly works with a core + addons added later

Well.. it works if the whole of Jetty (Http/1.1 AND Http/2 jars) are pre-loaded together in the core. Unfortunately in my case only the Jetty Http/1.1 jars are pre-loaded in the core, whereas Jetty Http/2 jars are post loaded via the addon.

try to hack a solution using reflection

Pity, doesn't work (can't change static final fields)..

@J-N-K
Copy link

J-N-K commented Jan 27, 2023

We'll fix that. I agree it's not a jetty issue.

@janbartel
Copy link
Contributor

Closing as it seems that the OpenHAB core folks are going to resolve this one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug For general bugs on Jetty side End-of-Life release
Projects
None yet
Development

No branches or pull requests

5 participants