Karaf 4.2.0 running ActiveMQ with WebSocket transport

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

Karaf 4.2.0 running ActiveMQ with WebSocket transport

IODB
I've installed ActiveMQ Blueprint on Karaf 4.2.0 with the commands:
feature:repo-add activemq 5.15.5
feature:repo-add spring-legacy
feature:install shell-compat
feature:install aries-blueprint
feature:install activemq-blueprint
feature:install jetty

When I drop an ActiveMQ blueprint file in the deploy folder, the broker
start up as expected.

However, when adding the ActiveMQ transport connector for websocket support
<transportConnector name="websocket" uri="ws://0.0.0.0:8181" />
the broker fails to start with an
ClassNotFoundException:
org.eclipse.jetty.websocket.server.WebSocketServerFactory

This despite that this class is present in one of the started Jetty bundles.

Can anyone tell me how to get the ActiveMQ websocket transport connector
working in Karaf 4.2.0?



--
Sent from: http://karaf.922171.n3.nabble.com/Karaf-User-f930749.html
Reply | Threaded
Open this post in threaded view
|

Re: Karaf 4.2.0 running ActiveMQ with WebSocket transport

jbonofre
Hi,

It's probably because the activemq bundle doesn't have optional import
to this package.

Can you try a dynamic import ?

Regards
JB

On 11/08/2018 15:16, IODB wrote:

> I've installed ActiveMQ Blueprint on Karaf 4.2.0 with the commands:
> feature:repo-add activemq 5.15.5
> feature:repo-add spring-legacy
> feature:install shell-compat
> feature:install aries-blueprint
> feature:install activemq-blueprint
> feature:install jetty
>
> When I drop an ActiveMQ blueprint file in the deploy folder, the broker
> start up as expected.
>
> However, when adding the ActiveMQ transport connector for websocket support
> <transportConnector name="websocket" uri="ws://0.0.0.0:8181" />
> the broker fails to start with an
> ClassNotFoundException:
> org.eclipse.jetty.websocket.server.WebSocketServerFactory
>
> This despite that this class is present in one of the started Jetty bundles.
>
> Can anyone tell me how to get the ActiveMQ websocket transport connector
> working in Karaf 4.2.0?
>
>
>
> --
> Sent from: http://karaf.922171.n3.nabble.com/Karaf-User-f930749.html
>

--
Jean-Baptiste Onofré
[hidden email]
http://blog.nanthrax.net
Talend - http://www.talend.com
Reply | Threaded
Open this post in threaded view
|

Re: Karaf 4.2.0 running ActiveMQ with WebSocket transport

IODB
So I've put the ActiveMQ blueprint file inside a bundle, and added
DynamicImport-Package: org.eclipse.jetty.websocket.server
to its manifest file.

Unfortunately the error remains. What am I doing wrong?

StackTrace:
java.lang.ClassNotFoundException:
org.eclipse.jetty.websocket.server.WebSocketServerFactory
        at java.net.URLClassLoader.findClass(URLClassLoader.java:381) ~[?:?]
        at java.lang.ClassLoader.loadClass(ClassLoader.java:424) ~[?:?]
        at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:349) ~[?:?]
        at java.lang.ClassLoader.loadClass(ClassLoader.java:357) ~[?:?]
        at java.lang.Class.forName0(Native Method) ~[?:?]
        at java.lang.Class.forName(Class.java:348) ~[?:?]
        at
org.eclipse.jetty.websocket.servlet.WebSocketServletFactory$Loader.load(WebSocketServletFactory.java:47)
~[?:?]
        at
org.eclipse.jetty.websocket.servlet.WebSocketServlet.init(WebSocketServlet.java:138)
~[?:?]
        at
org.apache.activemq.transport.ws.jetty9.WSServlet.init(WSServlet.java:79)
~[?:?]
        at javax.servlet.GenericServlet.init(GenericServlet.java:244) ~[?:?]
        at
org.eclipse.jetty.servlet.ServletHolder.initServlet(ServletHolder.java:637)
~[?:?]
        at
org.eclipse.jetty.servlet.ServletHolder.initialize(ServletHolder.java:421)
~[?:?]
        at
org.eclipse.jetty.servlet.ServletHandler.initialize(ServletHandler.java:760)
~[?:?]
        at
org.eclipse.jetty.servlet.ServletContextHandler.startContext(ServletContextHandler.java:348)
~[?:?]
        at
org.eclipse.jetty.server.handler.ContextHandler.doStart(ContextHandler.java:785)
~[?:?]
        at
org.eclipse.jetty.servlet.ServletContextHandler.doStart(ServletContextHandler.java:261)
~[?:?]
        at
org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:68)
~[?:?]
        at
org.eclipse.jetty.util.component.ContainerLifeCycle.start(ContainerLifeCycle.java:131)
~[?:?]
        at org.eclipse.jetty.server.Server.start(Server.java:452) ~[?:?]
        at
org.eclipse.jetty.util.component.ContainerLifeCycle.doStart(ContainerLifeCycle.java:105)
~[?:?]
        at
org.eclipse.jetty.server.handler.AbstractHandler.doStart(AbstractHandler.java:113)
~[?:?]
        at org.eclipse.jetty.server.Server.doStart(Server.java:419) ~[?:?]
        at
org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:68)
~[?:?]
        at
org.apache.activemq.transport.ws.WSTransportServer.doStart(WSTransportServer.java:91)
~[?:?]
        at org.apache.activemq.util.ServiceSupport.start(ServiceSupport.java:55)
~[?:?]
        at
org.apache.activemq.broker.TransportConnector.start(TransportConnector.java:251)
~[?:?]
        at
org.apache.activemq.broker.BrokerService.startTransportConnector(BrokerService.java:2747)
~[?:?]
        at
org.apache.activemq.broker.BrokerService.startAllConnectors(BrokerService.java:2640)
~[?:?]
        at
org.apache.activemq.broker.BrokerService.doStartBroker(BrokerService.java:771)
~[?:?]
        at
org.apache.activemq.broker.BrokerService.startBroker(BrokerService.java:733)
~[?:?]
        at org.apache.activemq.broker.BrokerService.start(BrokerService.java:636)
~[?:?]
        at
org.apache.activemq.xbean.XBeanBrokerService.afterPropertiesSet(XBeanBrokerService.java:73)
~[?:?]
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:?]
        at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
~[?:?]
        at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
~[?:?]
        at java.lang.reflect.Method.invoke(Method.java:498) ~[?:?]
        at
org.apache.aries.blueprint.utils.ReflectionUtils.invoke(ReflectionUtils.java:331)
~[?:?]
        at
org.apache.aries.blueprint.container.BeanRecipe.invoke(BeanRecipe.java:838)
~[?:?]
        at
org.apache.aries.blueprint.container.BeanRecipe.runBeanProcInit(BeanRecipe.java:591)
~[?:?]
        ... 27 more




--
Sent from: http://karaf.922171.n3.nabble.com/Karaf-User-f930749.html
Reply | Threaded
Open this post in threaded view
|

Re: Karaf 4.2.0 running ActiveMQ with WebSocket transport

jbonofre
You can try to use bundle:dynamic* command on the ActiveMQ OSGi bundle
(packaging the activemq blueprint in a bundle won't help).

Let me move forward on 4.2.1 and I will take a look.

Regards
JB

On 12/08/2018 08:58, IODB wrote:

> So I've put the ActiveMQ blueprint file inside a bundle, and added
> DynamicImport-Package: org.eclipse.jetty.websocket.server
> to its manifest file.
>
> Unfortunately the error remains. What am I doing wrong?
>
> StackTrace:
> java.lang.ClassNotFoundException:
> org.eclipse.jetty.websocket.server.WebSocketServerFactory
> at java.net.URLClassLoader.findClass(URLClassLoader.java:381) ~[?:?]
> at java.lang.ClassLoader.loadClass(ClassLoader.java:424) ~[?:?]
> at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:349) ~[?:?]
> at java.lang.ClassLoader.loadClass(ClassLoader.java:357) ~[?:?]
> at java.lang.Class.forName0(Native Method) ~[?:?]
> at java.lang.Class.forName(Class.java:348) ~[?:?]
> at
> org.eclipse.jetty.websocket.servlet.WebSocketServletFactory$Loader.load(WebSocketServletFactory.java:47)
> ~[?:?]
> at
> org.eclipse.jetty.websocket.servlet.WebSocketServlet.init(WebSocketServlet.java:138)
> ~[?:?]
> at
> org.apache.activemq.transport.ws.jetty9.WSServlet.init(WSServlet.java:79)
> ~[?:?]
> at javax.servlet.GenericServlet.init(GenericServlet.java:244) ~[?:?]
> at
> org.eclipse.jetty.servlet.ServletHolder.initServlet(ServletHolder.java:637)
> ~[?:?]
> at
> org.eclipse.jetty.servlet.ServletHolder.initialize(ServletHolder.java:421)
> ~[?:?]
> at
> org.eclipse.jetty.servlet.ServletHandler.initialize(ServletHandler.java:760)
> ~[?:?]
> at
> org.eclipse.jetty.servlet.ServletContextHandler.startContext(ServletContextHandler.java:348)
> ~[?:?]
> at
> org.eclipse.jetty.server.handler.ContextHandler.doStart(ContextHandler.java:785)
> ~[?:?]
> at
> org.eclipse.jetty.servlet.ServletContextHandler.doStart(ServletContextHandler.java:261)
> ~[?:?]
> at
> org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:68)
> ~[?:?]
> at
> org.eclipse.jetty.util.component.ContainerLifeCycle.start(ContainerLifeCycle.java:131)
> ~[?:?]
> at org.eclipse.jetty.server.Server.start(Server.java:452) ~[?:?]
> at
> org.eclipse.jetty.util.component.ContainerLifeCycle.doStart(ContainerLifeCycle.java:105)
> ~[?:?]
> at
> org.eclipse.jetty.server.handler.AbstractHandler.doStart(AbstractHandler.java:113)
> ~[?:?]
> at org.eclipse.jetty.server.Server.doStart(Server.java:419) ~[?:?]
> at
> org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:68)
> ~[?:?]
> at
> org.apache.activemq.transport.ws.WSTransportServer.doStart(WSTransportServer.java:91)
> ~[?:?]
> at org.apache.activemq.util.ServiceSupport.start(ServiceSupport.java:55)
> ~[?:?]
> at
> org.apache.activemq.broker.TransportConnector.start(TransportConnector.java:251)
> ~[?:?]
> at
> org.apache.activemq.broker.BrokerService.startTransportConnector(BrokerService.java:2747)
> ~[?:?]
> at
> org.apache.activemq.broker.BrokerService.startAllConnectors(BrokerService.java:2640)
> ~[?:?]
> at
> org.apache.activemq.broker.BrokerService.doStartBroker(BrokerService.java:771)
> ~[?:?]
> at
> org.apache.activemq.broker.BrokerService.startBroker(BrokerService.java:733)
> ~[?:?]
> at org.apache.activemq.broker.BrokerService.start(BrokerService.java:636)
> ~[?:?]
> at
> org.apache.activemq.xbean.XBeanBrokerService.afterPropertiesSet(XBeanBrokerService.java:73)
> ~[?:?]
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:?]
> at
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
> ~[?:?]
> at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
> ~[?:?]
> at java.lang.reflect.Method.invoke(Method.java:498) ~[?:?]
> at
> org.apache.aries.blueprint.utils.ReflectionUtils.invoke(ReflectionUtils.java:331)
> ~[?:?]
> at
> org.apache.aries.blueprint.container.BeanRecipe.invoke(BeanRecipe.java:838)
> ~[?:?]
> at
> org.apache.aries.blueprint.container.BeanRecipe.runBeanProcInit(BeanRecipe.java:591)
> ~[?:?]
> ... 27 more
>
>
>
>
> --
> Sent from: http://karaf.922171.n3.nabble.com/Karaf-User-f930749.html
>

--
Jean-Baptiste Onofré
[hidden email]
http://blog.nanthrax.net
Talend - http://www.talend.com
Reply | Threaded
Open this post in threaded view
|

Re: Karaf 4.2.0 running ActiveMQ with WebSocket transport

IODB
The 'bundle:dynamic-import <id of activemq-osgi bundle>' didn't seem to solve
the issue. (Karaf 4.2.1)

I've also tried to use dynamic-import with many of the other activemq and
jetty-websocket related bundles, with no success.





--
Sent from: http://karaf.922171.n3.nabble.com/Karaf-User-f930749.html
Reply | Threaded
Open this post in threaded view
|

Re: Karaf 4.2.0 running ActiveMQ with WebSocket transport

jbonofre
OK thanks for the update. I will do the fix in activemq.

Regards
JB

On 01/09/2018 08:21, IODB wrote:

> The 'bundle:dynamic-import <id of activemq-osgi bundle>' didn't seem to solve
> the issue. (Karaf 4.2.1)
>
> I've also tried to use dynamic-import with many of the other activemq and
> jetty-websocket related bundles, with no success.
>
>
>
>
>
> --
> Sent from: http://karaf.922171.n3.nabble.com/Karaf-User-f930749.html
>

--
Jean-Baptiste Onofré
[hidden email]
http://blog.nanthrax.net
Talend - http://www.talend.com
Reply | Threaded
Open this post in threaded view
|

Re: Karaf 4.2.0 running ActiveMQ with WebSocket transport

IODB
Hi JB,

Any update on this? I've tried this with the newest ActiveMQ 5.15.6, but
with no success.

Thanks



--
Sent from: http://karaf.922171.n3.nabble.com/Karaf-User-f930749.html
Reply | Threaded
Open this post in threaded view
|

Re: Karaf 4.2.0 running ActiveMQ with WebSocket transport

jbonofre
Hi

Yes, I did a change but it's on local branch. I will create the Jira at
ActiveMQ and create the PR.

Regards
JB

On 06/10/2018 08:55, IODB wrote:

> Hi JB,
>
> Any update on this? I've tried this with the newest ActiveMQ 5.15.6, but
> with no success.
>
> Thanks
>
>
>
> --
> Sent from: http://karaf.922171.n3.nabble.com/Karaf-User-f930749.html
>

--
Jean-Baptiste Onofré
[hidden email]
http://blog.nanthrax.net
Talend - http://www.talend.com