Thanks Achim, I didn't realize I was diverting from the favored way. Actually, I wasn't aware of Pax being provisioned at all with my current feature set, as I didn't expect any web stuff to be needed by them. Like Spring JMS that normally wouldn't depend on web APIs, but in the Karaf feature world it seems it does. I see many other features are quite eager to depend on "war" or "http", so I get what you're saying about having to handle many things manually. This is exactly what I don't want to do. The Felix Servlet Bridge seemed like a good match as we're running on Felix, but we could change that. Is there any production quality servlet bridge available that we can use with Pax? A search turned up the pax-exam-servlet-bridge module (3.x version); is this what you had in mind and does it work with Pax 1.1.3 as used in Karaf 2.3.0? I'd like to avoid having to roll my own. After solving the servlet bridge matters, I'm thinking we need to disable Jetty that is part of the standard http feature. How is this best done? Best regards Mike Achim Nierbeck wrote:
Hi, your scenario isn't really the favored way of using Karaf, why don't you use Karaf as is? Because of Pax-Web it will give you all that a std. Web-Container is capable of and complies to the OSGi HTTP-Service spec. To solve your issue you will need to install all required bundles without features since those usually depent on Pax-Web as it is the favored web container. Another way of doing this could be to dump the felix http service and use a custom adapted ServletBridge that uses the Pax-Web implementation, it can be done. I know that there is a project that uses Pax-Web with a custom ServletBridge. regards, Achim 2013/7/4 Mike Wilson <[email protected]> We are using Karaf (currently 2.3.0) embedded in Tomcat, using the Felix Servlet Bridge to expose various functionality on web pages. On some startups (random behaviour) our OSGi:fied web servlets are not reachable through Tomcat, and after some digging I've found that this problem goes away if I remove the spring-jms, feature because it is bringing in Pax Web: spring-jms -> spring-web -> http (= Pax Web incl Jetty) So I guess Felix and Pax Web will be competing about registering web artifacts, therefore the random behaviour. My question is how can we best resolve this problem? It seems a lot of libraries we use end up referring to the "war" or "http" features, bringing in Pax and its Jetty server, but we want to do our web traffic through Tomcat via the servlet bridge. How do we best override this behaviour? We'd like to stay on "standard Karaf" as much as possible (to make upgrades easier) so a solution with few and simple edits is desired... Thanks Mike Wilson
