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
jetty-websocket-core not usable standalone, only with websocket-javax-server or websocket-jetty-server #6601
Comments
Just to be clear, are you sure you are using All of the websocket artifacts have the The The The requirement on If you decide to use this, along with JPMS, then it's up to you to declare your usages in your own if you declared a new extension like module org.meeser.app {
// other init
// your extension
uses org.eclipse.jetty.websocket.core.Extension;
provides org.eclipse.jetty.websocket.core.Extension with
MeeserExtension;
} |
The problem is that in jetty 10 beta websocket-core-server was usable standalone. But no program is able to create an instance. The java module system will prevent it. The exception is exactly at:
The thrown exception is: This is due to change in module-info.java at websocket-core-server: There it does opens internals only to Jetty & Jakarta API Layers. However it does say:
So the it looks to me that the best fix is to replace The easiest fix would be to just open the internal packages to everyone. |
Sidenote:
|
So I looked at the "official" example by joakime here. I do not want to add all the boilerplate servlet context but just get it working... Updated gradle to:
Upgraded server configuration to:
The example is still not working with the same exception!? |
@martinmeeser I have been able to reproduce this. I'm currently working on a fix and to find out why this hasn't shown up in our current testing. |
AFAIK if you are using classpath only without module-path these examples will work.I remember JUnit Jupiter always uses classpath to make testing possible. ?? however I am not 100% about that and with a quick search I did not find any reference. |
Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
…dObjectFactory Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
…dObjectFactory Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
Issue #6601 - fix JPMS issues for websocket-core-common
@martinmeeser this has been fixed by PR #6680, we now export the websocket-core-common module to jetty-util for the |
Thank you very much. |
Is fixed in |
Jetty version(s)
Jetty 10.x, Jetty 11.x
Java version/vendor
(use: java -version)
not java version dependent
OS type/version
not os related
Description
I am using an embedded jetty. I am NOT using ServletContext handler.
I was using Jetty 10 beta.
I directly used a WebsocketUpgradeHandler from jetty-websocket-core, basically following the examples from the tests (ChatServer).
In the non-betas, this is not possible anymore.
The reason is the following:
In class
WebSocketExtensionRegistry lines 82-90:
This will lead to
``T o = clazz.getDeclaredConstructor().newInstance();
in in utils object factory.
Now this leads to an exception. I am assuming this is because the class is not exported in module-info.java (only to the websocket-javax-server or websocket-jetty-server).
So there is negotiation going on, the deflate extension is found, but it can not be instantiated, because the module system prevents it
The test should run fine since they can access the internal classes.
But any other usage of this module is not possible.
How to reproduce?
Use WebsocketUpgradeHandler in your own module.
The text was updated successfully, but these errors were encountered: