Apache Aries: how to make Osgi work with ServiceLoader

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Apache Aries: how to make Osgi work with ServiceLoader

Alex Sviridov
Hi all

I use jetty 9.3.11 and websockets on osgi. Jetty uses ServiceLoader to get websocket configuration.
After some research I installed and started two additional bundles:

org.apache.aries.util-1.1.1.jar
org.apache.aries.spifly.dynamic.bundle-1.0.1.jar

However, it didn't help because I still get the exception (see below).
What else should I do to make ServiceLoader work on Osgi (I use felix 5.4.0)?

java.lang.RuntimeException:Cannot load platform configurator
    at javax.websocket.server.ServerEndpointConfig$Configurator.fetchContainerDefaultConfigurator(ServerEndpointConfig.java:123)
    at javax.websocket.server.ServerEndpointConfig$Configurator.getContainerDefaultConfigurator(ServerEndpointConfig.java:128)
    at javax.websocket.server.ServerEndpointConfig$Configurator.checkOrigin(ServerEndpointConfig.java:192)
    at org.eclipse.jetty.websocket.jsr356.server.JsrCreator.createWebSocket(JsrCreator.java:88)
    at org.eclipse.jetty.websocket.server.WebSocketServerFactory.acceptWebSocket(WebSocketServerFactory.java:187)
    at org.eclipse.jetty.websocket.server.WebSocketUpgradeFilter.doFilter(WebSocketUpgradeFilter.java:207)
    at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1676)
    at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:581)

Reply | Threaded
Open this post in threaded view
|

Re: Apache Aries: how to make Osgi work with ServiceLoader

David Bosschaert
Hi Alex,

Sorry it took so long to respond, for some reason this message ended up in my spam folder.

You also need to add some configuration in the form of manifest headers to instruct SPI Fly what to do. Have a look for some documentation and instructions here: http://aries.apache.org/modules/spi-fly.html

Best regards,

David

On 29 September 2016 at 13:54, Alex Sviridov <[hidden email]> wrote:
Hi all

I use jetty 9.3.11 and websockets on osgi. Jetty uses ServiceLoader to get websocket configuration.
After some research I installed and started two additional bundles:

org.apache.aries.util-1.1.1.jar
org.apache.aries.spifly.dynamic.bundle-1.0.1.jar

However, it didn't help because I still get the exception (see below).
What else should I do to make ServiceLoader work on Osgi (I use felix 5.4.0)?

java.lang.RuntimeException:Cannot load platform configurator
    at javax.websocket.server.ServerEndpointConfig$Configurator.fetchContainerDefaultConfigurator(ServerEndpointConfig.java:123)
    at javax.websocket.server.ServerEndpointConfig$Configurator.getContainerDefaultConfigurator(ServerEndpointConfig.java:128)
    at javax.websocket.server.ServerEndpointConfig$Configurator.checkOrigin(ServerEndpointConfig.java:192)
    at org.eclipse.jetty.websocket.jsr356.server.JsrCreator.createWebSocket(JsrCreator.java:88)
    at org.eclipse.jetty.websocket.server.WebSocketServerFactory.acceptWebSocket(WebSocketServerFactory.java:187)
    at org.eclipse.jetty.websocket.server.WebSocketUpgradeFilter.doFilter(WebSocketUpgradeFilter.java:207)
    at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1676)
    at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:581)


Reply | Threaded
Open this post in threaded view
|

Re[2]: Apache Aries: how to make Osgi work with ServiceLoader

Alex Sviridov
Hi David

Thank you for your answer. The problem was in javax.websocket-api bundle.
See here for details http://stackoverflow.com/questions/39740531/jetty-websocket-java-lang-runtimeexception-cannot-load-platform-configurator

Best regards, Alex


Вторник, 4 октября 2016, 10:23 +03:00 от David Bosschaert <[hidden email]>:

Hi Alex,

Sorry it took so long to respond, for some reason this message ended up in my spam folder.

You also need to add some configuration in the form of manifest headers to instruct SPI Fly what to do. Have a look for some documentation and instructions here: http://aries.apache.org/modules/spi-fly.html

Best regards,

David

On 29 September 2016 at 13:54, Alex Sviridov <[hidden email]> wrote:
Hi all

I use jetty 9.3.11 and websockets on osgi. Jetty uses ServiceLoader to get websocket configuration.
After some research I installed and started two additional bundles:

org.apache.aries.util-1.1.1.jar
org.apache.aries.spifly.dynamic.bundle-1.0.1.jar

However, it didn't help because I still get the exception (see below).
What else should I do to make ServiceLoader work on Osgi (I use felix 5.4.0)?

java.lang.RuntimeException:Cannot load platform configurator
    at javax.websocket.server.ServerEndpointConfig$Configurator.fetchContainerDefaultConfigurator(ServerEndpointConfig.java:123)
    at javax.websocket.server.ServerEndpointConfig$Configurator.getContainerDefaultConfigurator(ServerEndpointConfig.java:128)
    at javax.websocket.server.ServerEndpointConfig$Configurator.checkOrigin(ServerEndpointConfig.java:192)
    at org.eclipse.jetty.websocket.jsr356.server.JsrCreator.createWebSocket(JsrCreator.java:88)
    at org.eclipse.jetty.websocket.server.WebSocketServerFactory.acceptWebSocket(WebSocketServerFactory.java:187)
    at org.eclipse.jetty.websocket.server.WebSocketUpgradeFilter.doFilter(WebSocketUpgradeFilter.java:207)
    at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1676)
    at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:581)




--
Alex Sviridov