Hi Vincent,

let me answer inline:

2015-02-06 18:00 GMT+01:00 Vincent Zurczak <[email protected]>:

>  Hi,
>
> I would like to implement a web socket in an OSGi application that runs in
> Karaf.
> I know Jetty 9.x comes with Pax-Web 4.x, which is itself used in Karaf 4.x.
>
> However, I have a custom Karaf distribution based on 3.x (3.0.2 now).
> And I wanted to use Pax-Web 4.1 with Karaf 3.x. Removing Pax-Web 3.x was
> easy. I then stopped Karaf and removed the *etc/jetty.xml* file, to
> prevent NoClassDefFound exceptions. When I restart Karaf, my former web
> applications work correctly. But I have errors with package imports in ...
> *karaf.http.core* and in the web console. This is related to the version
> of the *javax.servlet* package.
>

it might work, but you can't use the web feature etc. as those will also
try to install the web and http shell extensions.
Another drawback, since you can't use those features camel etc. won't be
able to resolve cause those are relying on the http feature of karaf.



>
> To be honest, I do not know what to do, hence this message.
>
> 1. One solution could be to switch to Karaf 4.x, but our project aims at
> being as stable as possible
> Contributing and testing Karaf 4.x would not be a problem, but relying on
> a development version for months is not the best option.
>
>
a M2 will be on vote in the next coming weeks, so be prepared ;-)


> 2. Another solution could be to implement web sockets with a different
> Java framework (but still deployed in Karaf).
> Since Jetty was already deployed in our custom distribution, it made sense
> to reuse it. But if we cannot, we will have to stick with another server.
> Or maybe is there another way of dealing with web sockets in Karaf?
>
>
btw. it's already possible to use websockets in Jetty 8, it's just not the
JSR-356 as in Pax Web 4.1.
There is a sample available at the pax web samples section [1]


> 3. An alternative could also be to support Pax-Web 4.x with Karaf 3.x.
> That would mean having the "standard" feature with Pax-Web 3.x and a
> "standard-4.x" with Pax-Web 4.x. If the name is not well-chosen, the idea
> is here. I do not know if it seems feasible with the package imports
> versions (there may be incompatible constraints). But if it is, I could try
> to help on this.
>

nope, just to much work to maintain. And since this is done mostly on
private basis ... just NO. :-)


>
> Otherwise, any suggestion is welcome.
> And last but not least, I mentioned custom distributions. If there was an
> automatic solution to deploy Pax-Web 4.x in Karaf 3.x, that would be great.
> I saw [0] on the bug tracker, it could be the solution. The 3rd option
> (above) would also fit.
>
> Thanks for reading me.
>
> Cheers,
>
>                 Vincent.
>
>
> [ 0 ] : https://issues.apache.org/jira/browse/KARAF-3259
>
>
> --
> Vincent Zurczak
> Linagora: www.linagora.com
>
> [image: Twitter] <https://twitter.com/VincentZurczak> [image: Vincent
> Zurczak @ LinkedIn]
> <http://fr.linkedin.com/pub/vincent-zurczak/18/b35/6a7> [image: My Skype
> ID] <callto://vincent.zurczak> [image: My English blog]
> <http://vzurczak.wordpress.com>
>


regards, Achim

[1] -
https://github.com/ops4j/org.ops4j.pax.web/tree/master/samples/karaf-websocket

-- 

Apache Member
Apache Karaf <http://karaf.apache.org/> Committer & PMC
OPS4J Pax Web <http://wiki.ops4j.org/display/paxweb/Pax+Web/> Committer &
Project Lead
blog <http://notizblog.nierbeck.de/>
Co-Author of Apache Karaf Cookbook <http://bit.ly/1ps9rkS>

Software Architect / Project Manager / Scrum Master

Reply via email to