Hi

You need to make sure that the following bundle is registered :

http://repo1.maven.org/maven2/org/apache/servicemix/specs/org.apache.servicemix.specs.jsr311-api-1.1/

(any maven version will probably do). This bundle will properly discover a
non-default JAX-RS implementation.

cheers, Sergey

On Thu, Jan 13, 2011 at 2:00 PM, Rice Yeh <[email protected]> wrote:

> Ok, I see what is going wrong. Sun's jaxrs implementation is the last
> resort
> if there is no implementation of jaxrs in claspath. So my cxf configuration
> has problem to cuase this problem.
>
> Rice
>
> On Thu, Jan 13, 2011 at 6:39 PM, Rice Yeh <[email protected]> wrote:
>
> > Hi,
> >   I am trying to run my application on osgi environment. I get a
> > java.lang.ClassNotFoundException: com.sun.ws.rs.ext.RuntimeDelegateImpl.
> I
> > can solve this problem by adding com.sun.* to system packages. However, I
> > wonder why com.sun.ws.ext is reached? The following is the stack trace:
> >
> > g! log4j:WARN No appenders could be found for logger
> > (org.hibernate.cfg.Environment).
> > log4j:WARN Please initialize the log4j system properly.
> > ERROR: Error starting file:bundles/xs-personnel.web_1.5.0.SNAPSHOT.jar
> > (org.osgi.framework.BundleException: Activator start error in bundle
> > xs-personnel.web [10].)
> > java.lang.ExceptionInInitializerError
> >     at
> org.apache.cxf.jaxrs.utils.JAXRSUtils.<clinit>(JAXRSUtils.java:104)
> >     at
> >
> org.apache.cxf.jaxrs.model.ClassResourceInfo.getConsumeMime(ClassResourceInfo.java:239)
> >     at
> >
> org.apache.cxf.jaxrs.model.OperationResourceInfo.checkMediaTypes(OperationResourceInfo.java:167)
> >     at
> >
> org.apache.cxf.jaxrs.model.OperationResourceInfo.<init>(OperationResourceInfo.java:74)
> >     at
> >
> org.apache.cxf.jaxrs.utils.ResourceUtils.createOperationInfo(ResourceUtils.java:337)
> >     at
> >
> org.apache.cxf.jaxrs.utils.ResourceUtils.evaluateResourceClass(ResourceUtils.java:214)
> >     at
> >
> org.apache.cxf.jaxrs.utils.ResourceUtils.createClassResourceInfo(ResourceUtils.java:200)
> >     at
> >
> org.apache.cxf.jaxrs.JAXRSServiceFactoryBean.createResourceInfo(JAXRSServiceFactoryBean.java:186)
> >     at
> >
> org.apache.cxf.jaxrs.JAXRSServiceFactoryBean.setResourceClasses(JAXRSServiceFactoryBean.java:150)
> >     at
> >
> org.apache.cxf.jaxrs.JAXRSServiceFactoryBean.setResourceClasses(JAXRSServiceFactoryBean.java:195)
> >     at
> >
> org.apache.cxf.jaxrs.JAXRSServerFactoryBean.setResourceClasses(JAXRSServerFactoryBean.java:171)
> >     at xs.personnel.Activator.start(Activator.java:41)
> >     at
> >
> org.apache.felix.framework.util.SecureAction.startActivator(SecureAction.java:633)
> >     at org.apache.felix.framework.Felix.activateBundle(Felix.java:1862)
> >     at org.apache.felix.framework.Felix.startBundle(Felix.java:1779)
> >     at
> > org.apache.felix.framework.Felix.setActiveStartLevel(Felix.java:1188)
> >     at
> > org.apache.felix.framework.StartLevelImpl.run(StartLevelImpl.java:264)
> >     at java.lang.Thread.run(Thread.java:619)
> > Caused by: java.lang.RuntimeException: java.lang.ClassNotFoundException:
> > com.sun.ws.rs.ext.RuntimeDelegateImpl
> >     at
> > javax.ws.rs.ext.RuntimeDelegate.findDelegate(RuntimeDelegate.java:122)
> >     at
> javax.ws.rs.ext.RuntimeDelegate.getInstance(RuntimeDelegate.java:91)
> >     at javax.ws.rs.core.MediaType.<clinit>(MediaType.java:44)
> >     ... 18 more
> > Caused by: java.lang.ClassNotFoundException:
> > com.sun.ws.rs.ext.RuntimeDelegateImpl
> >     at
> >
> org.apache.felix.framework.ModuleImpl.findClassOrResourceByDelegation(ModuleImpl.java:772)
> >     at
> org.apache.felix.framework.ModuleImpl.access$200(ModuleImpl.java:73)
> >     at
> >
> org.apache.felix.framework.ModuleImpl$ModuleClassLoader.loadClass(ModuleImpl.java:1685)
> >     at java.lang.ClassLoader.loadClass(ClassLoader.java:252)
> >     at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:320)
> >     at java.lang.Class.forName0(Native Method)
> >     at java.lang.Class.forName(Class.java:169)
> >     at javax.ws.rs.ext.FactoryFinder.newInstance(FactoryFinder.java:62)
> >     at javax.ws.rs.ext.FactoryFinder.find(FactoryFinder.java:155)
> >     at
> > javax.ws.rs.ext.RuntimeDelegate.findDelegate(RuntimeDelegate.java:105)
> >     ... 20 more
> >
> >
> > Rice
> >
>

Reply via email to