Hi Sergey, Let me explain my first problem more clearer as inlined below.
On Sat, Mar 3, 2012 at 1:33 AM, Sergey Beryozkin <[email protected]>wrote: > Hi Rice > > On 02/03/12 16:47, Rice Yeh wrote: > >> Hi Sergey, >> After looking into the source code in cxf, I find a lot of classes for >> OSGi are added in cxf now. I know there is a osgiservlet in >> cxf-rf-transports-http and run in Karaf, it seems that it is constructed >> but it is not added to the http service. Do you know where the code is for >> adding osgiservlet to http service? >> > > It's activated by Blueprint finding the resource in OSGI-INF in > cxf-rt-transports-http; you can view it as a default CXF servlet and if a > single context will do for then you can rely on it... > > > After installing cxf feature from repository mvn:org.apache.cxf.karaf/apache-cxf/2.5.2/xml/features, I can access http://localhost:8080/cxf. On the other hand, if I just add cxf-bundle-jaxrs-2.5.2.jar bundle, I cannot access http://localhost:8080/cxf. For cxf feature, karaf ls command shows me the following services: Apache CXF Bundle Jar (133) provides: ------------------------------------- org.osgi.service.cm.ManagedServiceFactory org.osgi.service.cm.ManagedService org.osgi.service.cm.ManagedService org.apache.aries.blueprint.NamespaceHandler org.apache.aries.blueprint.NamespaceHandler org.apache.aries.blueprint.NamespaceHandler org.apache.aries.blueprint.NamespaceHandler org.apache.aries.blueprint.NamespaceHandler org.apache.aries.blueprint.NamespaceHandler org.apache.aries.blueprint.NamespaceHandler org.apache.aries.blueprint.NamespaceHandler javax.servlet.Servlet javax.servlet.ServletContext org.apache.aries.blueprint.NamespaceHandler org.apache.aries.blueprint.NamespaceHandler org.apache.cxf.transport.http.DestinationRegistry org.osgi.service.blueprint.container.BlueprintContainer For the cxf-bundle-jaxrs-2.5.2.jar, ls command gives me the following services: Apache CXF JAX-RS Bundle Jar (111) provides: -------------------------------------------- org.osgi.service.cm.ManagedServiceFactory org.osgi.service.cm.ManagedService org.osgi.service.cm.ManagedService org.apache.aries.blueprint.NamespaceHandler org.apache.cxf.transport.http.DestinationRegistry org.apache.aries.blueprint.NamespaceHandler javax.servlet.Servlet org.osgi.service.blueprint.container.BlueprintContainer I think the biggest difference is the javax.servlet.ServletContext. jaxrs-bundle has osgiservlet constructed but it is not registered to the http service. Where is the registering done? Also, you say there is a cxf-jaxrs feature, I cannot find in the above repository for the cxf feature. Rice > > Also, I do not use karf feature from >> apache cxf because it is too big in terms of bundles included. For my >> project, I just need jaxrs. >> >> If you look at the karaf feature file, there's a cxf-jaxrs feature > there. The cxf-jaxrs bundle can help too. I'm hoping to look into the > better osgi-ification of the jaxrs frontend in more depth probably > immediately after 2.6.0 (frontend specific activator, etc), though I might > get a bit of time before the release too, > > Let me know please how this project goes > > Cheers, Sergey > > Rice >> >>
