Hi again, processing my mail in inverse cronological order and realizing that the previous post might not have been very helpfull as you already have the example running in a non-karaf environment.
As far as I know the mechanism by which the servlet filter is registered is supported only by the felix http service. The servlet filter is just registered as a service and annotated with some properties. So I guess that a different http-service being used is the reason things don't work in your karaf setting. You could try the wink-osgi bundle which supports jax-rs but no sling-rs resources, presumably it doesn't work as the filter is registererd with the same mechanism. A usage example is here: http://svn.apache.org/viewvc/incubator/wink/trunk/wink-examples/ext/OSGi/ Cheers, Reto On Fri, May 11, 2012 at 4:06 PM, [email protected] < [email protected]> wrote: > Hi! > > I am trying to bring some legacy jax-rs classes into my sling > installation. > I deployed org.apache.sling.extensions.jaxrs into Sling and > everything seems to be working nicely. > When Sling is running in Karaf only the sling-rs resources are > workin, the jax-rs are not. > To narrow down the problem I deployed the "JAX-RS/SLING-RS Sample" > into a clean standalone Sling > and into one running within Karaf. > The installation looks the same in both cases > > Sling: > *INFO* [FelixDispatchQueue] org.apache.sling.extensions.jaxrs.sample > BundleEvent INSTALLED > *INFO* [FelixDispatchQueue] org.apache.sling.extensions.jaxrs.sample > BundleEvent RESOLVED > *INFO* [Background Install > C:UsersmgAppDataLocalTempinstall3717890895037484530.tmp] > org.apache.wink.server.internal.application.ApplicationProcessor The > following JAX-RS application has been processed: > org.apache.wink.server.utils.RegistrationUtils$InnerApplication > *INFO* [Background Install > C:UsersmgAppDataLocalTempinstall3717890895037484530.tmp] > org.apache.sling.jaxrs.wink.WinkRequestProcessor registered component > org.apache.sling.jaxrs.sample.GreetingWriter@723bfc52 > *INFO* [Background Install > C:UsersmgAppDataLocalTempinstall3717890895037484530.tmp] > org.apache.sling.extensions.jaxrs.sample Service > [org.apache.sling.jaxrs.sample.GreetingWriter,161] ServiceEvent > REGISTERED > *INFO* [Background Install > C:UsersmgAppDataLocalTempinstall3717890895037484530.tmp] > org.apache.wink.server.internal.application.ApplicationProcessor The > following JAX-RS application has been processed: > org.apache.wink.server.utils.RegistrationUtils$InnerApplication > *INFO* [Background Install > C:UsersmgAppDataLocalTempinstall3717890895037484530.tmp] > org.apache.sling.jaxrs.wink.WinkRequestProcessor registered component > org.apache.sling.jaxrs.sample.SimpleRootResource@15ec68e9 > *INFO* [Background Install > C:UsersmgAppDataLocalTempinstall3717890895037484530.tmp] > org.apache.sling.extensions.jaxrs.sample Service > [org.apache.sling.jaxrs.sample.SimpleRootResource,162] ServiceEvent > REGISTERED > *INFO* [FelixDispatchQueue] org.apache.sling.extensions.jaxrs.sample > BundleEvent STARTED > > Sling in Karaf: > | INFO | lixDispatchQueue | sample | 119 - > org.apache.sling.commons.log - 2.1.2 | BundleEvent INSTALLED > | INFO | lixDispatchQueue | sample | 119 - > org.apache.sling.commons.log - 2.1.2 | BundleEvent RESOLVED > | INFO | 423708686658.tmp | ApplicationProcessor | 145 - > org.apache.sling.extensions.jaxrs - 0.9.9.SNAPSHOT | The following > JAX-RS application has been processed: > org.apache.wink.server.utils.RegistrationUtils$InnerApplication > | INFO | 423708686658.tmp | WinkRequestProcessor | 145 - > org.apache.sling.extensions.jaxrs - 0.9.9.SNAPSHOT | registered > component org.apache.sling.jaxrs.sample.GreetingWriter@25f71a09 > | INFO | 423708686658.tmp | sample | 119 - > org.apache.sling.commons.log - 2.1.2 | Service > [org.apache.sling.jaxrs.sample.GreetingWriter,348] ServiceEvent > REGISTERED > | INFO | 423708686658.tmp | ApplicationProcessor | 145 - > org.apache.sling.extensions.jaxrs - 0.9.9.SNAPSHOT | The following > JAX-RS application has been processed: > org.apache.wink.server.utils.RegistrationUtils$InnerApplication > | INFO | 423708686658.tmp | WinkRequestProcessor | 145 - > org.apache.sling.extensions.jaxrs - 0.9.9.SNAPSHOT | registered > component org.apache.sling.jaxrs.sample.SimpleRootResource@5d6227a2 > | INFO | 423708686658.tmp | sample | 119 - > org.apache.sling.commons.log - 2.1.2 | Service > [org.apache.sling.jaxrs.sample.SimpleRootResource,349] ServiceEvent > REGISTERED > | INFO | lixDispatchQueue | sample | 119 - > org.apache.sling.commons.log - 2.1.2 | BundleEvent STARTED > > Result in Sling standalone: > > http://localhost:8080/testing/jaxrs/SimpleRootResource -> works > > Result in Sling/Karaf: > > http://localhost:8181/testing/jaxrs/SimpleRootResource -> does not > work and logs > | INFO | esource HTTP/1.1 | SlingRequestProcessorImpl | 93 - > org.apache.sling.engine - 2.2.2 | service: Resource > /testing/jaxrs/SimpleRootResource not found > > Any idea what would need to be configured differently to get it > running with Sling/Karaf? > > regards, > > Marius
