camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Sergey Beryozkin <sberyoz...@gmail.com>
Subject Re: Camel CXF Jaxrs service implementation class's methods are not executing
Date Fri, 04 Apr 2014 14:34:09 GMT
Hi

It is not possible to use jaxrs:server in combination with cxfrs, it is 
only possible to do

<jaxrs:server id="userManagerREST" address="camel:/route">
</jaxrs:server>

and then direct to from the camel route typically starting from a 
servlet. This approach is somewhat limited unless one is prepared to 
have JAX-RS server implementation be written with Camel API in mind.

CXF ships org.apache.cxf.jaxrs.provider.CachingMessageBodyWriter and
org.apache.cxf.jaxrs.provider.CachingMessageBodyReader, the idea is that 
that they can be used to let jaxrs:server be used in arbitrary parts of 
the route, however I still have to experiment with them myself.

I have another idea about making native jaxrs;server endpoints easier 
reusable in the routes, but I haven;t had time to code them.

have a look at CAMEL-7147, it has a project attached showing the 
combination of cxfrs:server & cxfrs:bean

HTH, Sergey


On 04/04/14 13:01, vrahul wrote:
> Thanks Sergey,
>
> I have also tried by creating services using cxf jaxrs server endpoint as
> below
>
> <jaxrs:server id="userManagerREST" address="/rest/UserManager">
>          <jaxrs:serviceBeans>
>              <ref bean="resttestid"/>
>          </jaxrs:serviceBeans>
>          <jaxrs:providers>
>              <bean class="org.codehaus.jackson.jaxrs.JacksonJsonProvider"/>
>          </jaxrs:providers>
>      </jaxrs:server>
>
> and used in camel
>
> <from uri="cxfrs://bean://userManagerREST"/>
>
> I might consider experimenting with camel restlet , http and jetty but also
> those will come under the scope of project, that will be my another option,
> better i am looking for a way to have control inside the implementation
> class, so at least ill be able to ExceptionMapper, as of now i am not able
> to use ExceptionMapper to map my custom exception with
> WebApplicationException
>
>
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/Camel-CXF-Jaxrs-service-implementation-class-s-methods-are-not-executing-tp5749733p5749794.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>


Mime
View raw message