Hi, Your solution is correct. Normally jax-rs and jax-ws endpoints in OSGi share default servlet handler (registered as HTTP service) covering a single context. The OSGi ConfigAdmin pid "org.apache.cxf.osgi" and property "org.apache.cxf.servlet.context" are designed to configure this context path. CXF blueprint namespace handlers are used to configure individual jax-rs / jax-ws endpoints activating under this context. Therefore you can set relative paths of your endpoints in blueprint, but not the basic context path.
In some rarely cases you may need to have multiple servlet contexts, see some details about this in http://cxf.547215.n5.nabble.com/Multiple-servlets-in-JAXRS-OSGi-blueprint-td5530471.html . Regards, Andrei. > -----Original Message----- > From: Arnaud Mergey [mailto:[email protected]] > Sent: Freitag, 23. Oktober 2015 18:09 > To: [email protected] > Subject: Replace "/cxf" base path with something else with blueprint in > equinox > > Hello, > > By default inside osgi, CXF servlet is registerd with /cxf alias. > > I would like to replace /cxf with /foo for example. > > My application is an osgi application configured using blueprint and running > inside equinox (but I am using aries blueprint) > > Every info I found on internet explain how to do that on various container > like > karaf, fuse, ... > but none in "regular" osgi. > > I am using CXF 3.1.3 and I have looked at in the code and CXF servlet is > registerd by org.apache.cxf.transport.http.osgi.ServletExporter. It seems > "/cxf" > can be replaced with something else defining a > "org.apache.cxf.servlet.context" > property (alias = (String)getProp(properties, > "org.apache.cxf.servlet.context", > "/cxf");). > > I do not find any way to configure this property with blueprint. > My guess is if I create a configuration in ConfigAdmin with pid > "org.apache.cxf.osgi" and "org.apache.cxf.servlet.context=/foo" it is supposed > to work, but it seems not really clean, I would prefer to find a way to do > this in > my blueprint xml file. > Is there any way ? > > Thanks > Arnaud >
