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
Description
We are trying to migrate our websocket services from Jetty 9.4.x to 11.0.x, we encounter 2 OSGi issues.
We have been using OSGi and Felix in the OW2/Joram project for many years. We have a working setup with Felix (7.0.5), Jetty 9.4, Felix Http and Jetty websocket bundles. Recently we upgraded our libraries to JEE 10: Jetty 11.0.18, Jersey 3.1.3, Felix Http (5.1.6). Our Rest services work correctly on this new platform, unfortunately we cannot find a working configuration for our websockets server.
We found a minimum configuration with the following bundles:
The 2 errors above seem to be due to OSGi extensions requested by the "org.eclipse.jetty.webapp" and "org.eclipse.jetty.websocket.common" bundles. I searched in the Jetty code and these annotations appeared from version 10:
For the jetty-webapp bundle, the origin seems older but linked to the branches of versions 10 and 11.
Is this behavior correct? If so, what should I do to get around it? What would then be the correct OSGi configuration to start a Jetty websocket server with OSGi and more especially Felix?
After adding an implementation of osgi.serviceloader.registrar/osgi.serviceloader.extender (spifly) all bundles are now correctly loaded.
However, I did an experiment by manually editing the manifests of the erroring bundles (*1) to remove the Require-Capability line and it seems to work. Would it be possible to generate these bundles without this mandatory dependency on spifly (or equivalent)?
(*1) jetty-webapp.jar, websocket-jetty-common.jar and websocket-jetty-client.jar.
The Require-Capability is a requirement to allow java.util.ServiceLoader to work.
Removing support for java.util.ServiceLoader is not a valid setup for Jetty.
Jetty 9 had few usages of java.util.ServiceLoader, but the upgrade to Jakarta EE 9 / Jetty 11, means that java.util.ServiceLoader is now a mandatory requirement for things to function properly across many things within Jetty itself, and it's various dependencies.
Jetty version(s)
Jetty 11.0.18
Java version/vendor
(use: java -version)
JDK 11.0.20.1
OS type/version
Windows 10
Description
We are trying to migrate our websocket services from Jetty 9.4.x to 11.0.x, we encounter 2 OSGi issues.
We have been using OSGi and Felix in the OW2/Joram project for many years. We have a working setup with Felix (7.0.5), Jetty 9.4, Felix Http and Jetty websocket bundles. Recently we upgraded our libraries to JEE 10: Jetty 11.0.18, Jersey 3.1.3, Felix Http (5.1.6). Our Rest services work correctly on this new platform, unfortunately we cannot find a working configuration for our websockets server.
We found a minimum configuration with the following bundles:
But during startup we have the following errors:
The 2 errors above seem to be due to OSGi extensions requested by the "org.eclipse.jetty.webapp" and "org.eclipse.jetty.websocket.common" bundles. I searched in the Jetty code and these annotations appeared from version 10:
Is this behavior correct? If so, what should I do to get around it? What would then be the correct OSGi configuration to start a Jetty websocket server with OSGi and more especially Felix?
PS: This problem may also be related to #6418.
The text was updated successfully, but these errors were encountered: