I'm trying to publish a rest-style web service from an OSGI bundle. I've installed the cxf-bundle-2.2-SNAPSHOT.jar bundle (built from the trunk today) into apache felix. Here's the code, copied directly from the cxf documentation.

       JAXRSServerFactoryBean sf = new JAXRSServerFactoryBean();
       sf.setResourceClasses(SampleRestServiceImpl.class);
       sf.setAddress("http://localhost:8000/";);
       sf.create();

The stack trace I'm getting is this:

Nov 20, 2008 12:57:31 PM org.apache.cxf.BusFactory newInstance
SEVERE: Failed to instantiate bus factory.
java.lang.ClassCastException: class org.apache.cxf.bus.spring.SpringBusFactory
   at java.lang.Class.asSubclass(Class.java:2979)
   at org.apache.cxf.BusFactory.newInstance(BusFactory.java:164)
   at org.apache.cxf.BusFactory.newInstance(BusFactory.java:140)
   at org.apache.cxf.BusFactory.getDefaultBus(BusFactory.java:69)
   at org.apache.cxf.BusFactory.getThreadDefaultBus(BusFactory.java:106)
   at org.apache.cxf.BusFactory.getThreadDefaultBus(BusFactory.java:97)
at org.apache.cxf.endpoint.AbstractEndpointFactory.getBus(AbstractEndpointFactory.java:73) at org.apache.cxf.jaxrs.JAXRSServerFactoryBean.createEndpointInfo(JAXRSServerFactoryBean.java:180) at org.apache.cxf.jaxrs.JAXRSServerFactoryBean.createEndpoint(JAXRSServerFactoryBean.java:146) at org.apache.cxf.jaxrs.JAXRSServerFactoryBean.create(JAXRSServerFactoryBean.java:88)

Publishing wsdl-based web services using Endpoint.publish(address, webService) works just fine.

Any ideas what's up with my JAX-RS code / configuration?

Thanks,
Josh

Reply via email to