adding web socket handler to karaf's jetty

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view

adding web socket handler to karaf's jetty


I'm trying to add a web socket handler to the jetty running inside karaf and can't get it working the way I'd like.

I tried adding a new handler inside the jetty.xml file for karaf, but it cannot find my handler class, as it is in a different osgi bundle (its got its own eclipse project).

                <Set name="handler">
                                <New class="org.eclipse.jetty.server.handler.HandlerList">
                                                <Set name="handlers">
                                                                <Array type="org.eclipse.jetty.server.Handler">
                                                                                               <New class="com.mything.service.server.subscription.impl.MyWebSocketHandler">

I could copy my bundle into the apache-karaf project, but that solution is messy and I'd like to do this better. Loading a WebSocketServlet through jetty.xml has exactly the same problem (as expected).

Since the bundle my handler is in is also an osgi bundle, I tried loading it using the bundles service.xml hoping (faintly) karaf would be smart enough to load a web socket servlet into the web socket handler automatically, but either I did that wrong or its not going to do that for me.

Any suggestions? Is there a "path" sort of thing I can add my package to so karaf can find it when loading jetty.xml?

Thanks for any help