cxf-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From John-M Baker <john-m.ba...@db.com>
Subject Re: CXF 2.1, Rest and Spring configuration
Date Tue, 29 Apr 2008 14:19:43 GMT
Sergey,

So I've now got a system running fine with jaxrs and the standalone server 
option works as expected. However I've used the example at the bottom of 
this page:

http://cwiki.apache.org/CXF20DOC/jax-rs-jsr-311.html

and produced this Spring context:

<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xmlns:jaxrs="http://cxf.apache.org/jaxrs"
  xsi:schemaLocation="
http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans.xsd
http://cxf.apache.org/jaxrs
http://cxf.apache.org/schemas/jaxrs.xsd">

  <import resource="classpath:META-INF/cxf/cxf.xml"/>
  <import 
resource="classpath:META-INF/cxf/cxf-extension-http-binding.xml"/>
  <import resource="classpath:META-INF/cxf/cxf-servlet.xml"/>

  <jaxrs:server id="cxf.server.ApplicationConfigurationService" 
address="/">
    <jaxrs:serviceBeans>
      <bean 
class="com.db.websso.rest.server.ApplicationConfigurationServiceImpl" />
    </jaxrs:serviceBeans>
  </jaxrs:server> 
 
</beans>

which results in this exception:

org.apache.cxf.BusException: No binding factory for namespace 
http://apache.org/cxf/binding/jaxrs registered.
        at 
org.apache.cxf.binding.BindingFactoryManagerImpl.getBindingFactory(
BindingFactoryManagerImpl.java:91)
        at org.apache.cxf.jaxrs.JAXRSServerFactoryBean.createBindingInfo(
JAXRSServerFactoryBean.java:208)
 
Is the webpage out of date?


John Baker
-- 
Web SSO 
IT Infrastructure 
Deutsche Bank London

URL:  http://websso.cto.gt.intranet.db.com




"Sergey Beryozkin" <sergey.beryozkin@iona.com> 
29/04/2008 11:50
Please respond to
users@cxf.apache.org


To
<users@cxf.apache.org>
cc

Subject
Re: CXF 2.1, Rest and Spring configuration






Hi John,

In your bean.xml you can do something like :

<beans>
<!-- your service class -->
<bean name="ServiceClass" class="com.Service">

<!-- JAXWS SOAP-->
<jaxws:endpoint implementor="#ServiceClass" address="/Greeter"/>

<!-- JAXRS -->
<jaxrs:server address="/jaxrsgreeter">
<jaxrs:serviceBeans>
      <bean ref="#ServiceClass" />
</jaxrs:serviceBeans>
</jaxrs:server>

<!-- JAXWS HTTP Binding -->
<jaxws:endpoint implementor="#ServiceClass" 
address="/GreeterHttpBinding"/>

</beans>

and then have both JAX-WS and JAX-RS annotations applied to the 
com.Service class at will...

By the way, as far as writing RESTful services is concerned, I do 
encourage you to migrate your HTTP Binding service to JAX-RS. 
JAX-RS is a standard and in the end of the day you should be able to run 
the same code with different JAX-RS implementations

Cheers, Sergey 

----------------------------
IONA Technologies PLC (registered in Ireland)
Registered Number: 171387
Registered Address: The IONA Building, Shelbourne Road, Dublin 4, Ireland



---

This e-mail may contain confidential and/or privileged information. If you are not the intended
recipient (or have received this e-mail in error) please notify the sender immediately and
delete this e-mail. Any unauthorized copying, disclosure or distribution of the material in
this e-mail is strictly forbidden.

Please refer to http://www.db.com/en/content/eu_disclosures.htm for additional EU corporate
and regulatory disclosures.
Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message