Hi chrispy,

Deploy a rest endpoint using CXFRS without launching a new server:

1) add maven dependencies pom.xml (me i've added : camel-cxf,
cxf-bundle-jaxrs and cxf-rt-frontend-jaxrs with cxf version      

    2.6.1)

2) configure web.xm
 <servlet>
        <servlet-name>CXFServlet</servlet-name>
       
<servlet-class>org.apache.cxf.transport.servlet.CXFServlet</servlet-class>
     <load-on-startup>1</load-on-startup>
    </servlet>
    <servlet-mapping>
        <servlet-name>CXFServlet</servlet-name>
        <url-pattern>/rest/*</url-pattern> 
    </servlet-mapping>

3) add server bean in spring context
 <jaxrs:server id="sampleResource" address="/">
        <jaxrs:serviceBeans>
            <bean class="com.example.rest.SampleResource" />
        </jaxrs:serviceBeans>
    </jaxrs:server>

4) define a routeBuilder (in java or in xml)
   from("cxfrs://bean://sampleResource")....to(...)

5) your com.example.rest.SampleResource
is jax-rs bean that exposes your uri.

ask if you encounter problems.
cheers.
 



--
View this message in context: 
http://camel.465427.n5.nabble.com/StackOverflowError-when-using-restlet-component-with-relative-path-tp5722101p5722865.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Reply via email to