Probably you must be missing 'cxf_tr_frontend_jaxrs' jar  in the classpath.
After adding to classpath. I had the same issue, after adding it to
classpath, it worked with Spring configuration as per the documentation.

--Vijay

On 4/28/08 9:12 AM, "John-M Baker" <[EMAIL PROTECTED]> wrote:

> Hello,
> 
> I've been looking at the CXF 2.1 restful_http_binding example and I'd like
> to run it through Spring. Is there an example of how to do the following
> through Spring:
> 
>     private static void createRestService(Object serviceObj) {
>         // Build up the server factory bean
>         JaxWsServerFactoryBean sf = new JaxWsServerFactoryBean();
>         sf.setServiceClass(CustomerService.class);
>         // Use the HTTP Binding which understands the Java Rest
> Annotations
>         sf.setBindingId(HttpBindingFactory.HTTP_BINDING_ID);
>         sf.setAddress("http://localhost:8080/xml/";);
>         sf.getServiceFactory().setInvoker(new BeanInvoker(serviceObj));
> 
>         // Turn the "wrapped" style off. This means that CXF won't
> generate
>         // wrapper XML elements and we'll have prettier XML text. This
>         // means that we need to stick to one request and one response
>         // parameter though.
>         sf.getServiceFactory().setWrapped(false);
> 
>         sf.create();
>     }
>  
> I've looked at this URL:
> 
> http://cwiki.apache.org/CXF20DOC/jax-rs-jsr-311.html
> 
> Which is great, but a little confusing as the beans.xml file isn't very
> well documented and I couldn't make the example work:
> 
> org.springframework.beans.factory.xml.XmlBeanDefinitionStoreException:
> Line 15 in XML document from class path resource [cxf-server-context.xml]
> is invalid; nested exception is org.xml.sax.SAXParseException:
> cvc-complex-type.2.4.c: The matching wildcard is strict, but no
> declaration can be found for element 'jaxrs:server'.
> Caused by: 
> org.xml.sax.SAXParseException: cvc-complex-type.2.4.c: The matching
> wildcard is strict, but no declaration can be found for element
> 'jaxrs:server'.
>   at 
> com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.createSAXParseExce
> ption(Unknown 
> Source)
>   at 
> com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.error(Unknown
> Source)
>  
> But I suspect the beans.xml file isn't quite what I want to be copying.
> 
> So, im summary, can someone give me an example Spring context that will
> setup the JaxWsServerFactoryBean
> 
> Thanks,
> 
> 
> John

Reply via email to