-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
Remove deprecation of HttpClient replacement methods in WebSocketClient #3663
Comments
As reported by the cometd project - cometd/cometd#862 If the webSocketClient.getHttpClient().setConnectTimeout(30000);
webSocketClient.getHttpClient().setCookieStore(cookieStore); That can result in a linkage error ...
all because they followed the recommendations in the |
+ Those methods and constructors that had @Deprecation assigned that urged the use of HttpClient directly are no longer annotated as deprecated because of legitimate possibility of a valid LinkageError Signed-off-by: Joakim Erdfelt <[email protected]>
Opened PR #3665 |
…-wsclient-with-httpclient Issue #3663 - Remove @Deprecation's from WebSocketClient
Closing due to merge into mainline |
Seems this change was overridden by #3730 (PR #4423)? Could someone comment on this? I got same error in version 9.4.35.v20201120 when create WebsocketClient with given HttpClient. ` HttpClient httpClient = new org.eclipse.jetty.client.HttpClient(sslContextFactory); |
@jwhgithub what exact error do you get? The The code snippet above it's done inside a web application? |
Hi Sbordet, Thanks for your reply. Yes, the code above is inside a web application. Error message is like below: 2020-12-15T23:18:31,189 [qtp738772871-36] WARN [AbstractWebSocketWrapper] - WebSocket error. java.lang.LinkageError: loader constraint violation: when resolving method |
@jwhgithub do you have the websocket client jars included in your WEB-INF/lib, or are you using provided dependency from the server? If you are using the websocket client jars as provided dependencies from the server, you would need to configure the If you are not using a provided dependency and have the jars in WEB-INF/lib then you will need to hide the servers jetty-websocket-client classes from the webapp. You should add the following configuration to your
This will also mean for the server you will only be able to use the javax.websocket API and not the Jetty WebSocket API. |
@lachlan-roberts Thanks a lot for your detailed reply. Sorry for providing my feedback so late. When I tried the same with jetty 9.4.14.v20181114, I noticed the "DefaultHttpClientProvider" could provide a httpClient with SslContextFactory[trustAll=false], seems the XML Config doesn't impact DefaultHTTPClientProvider. |
@jwhgithub there have been fixes to the |
No description provided.
The text was updated successfully, but these errors were encountered: