cxf-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Sergey Beryozkin (JIRA)" <>
Subject [jira] [Commented] (CXF-3617) Automatic Type Converters for Restful Clients
Date Thu, 21 Jul 2011 17:54:57 GMT


Sergey Beryozkin commented on CXF-3617:

> No, I think a better solution would be automatic registration. This is how the Restlet
library does it. You don't have to worry about mappings. 

Well, we do ship a default JSONProvider which assumes objects are JAXB beans - those will
be automatically mapped. On top of it we can customize a lot JSONProvider works with data.
Thus we can't drop it and replace with Jackson or XMLStream provider.  
We can also application/x+bar medium type and MyObject - would you expect it automatically
mapped as well ?

The point I'm making is that we ship a default JSONProvider. And registering custom or existing
3rd party providers is very easy. Even if CXF did ship say XStream provider then you;d still
need to register it explicitly for it to be preferred to the default JSONProvider - but I
don't think we can afford shipping multiple JSON providers

> Automatic Type Converters for Restful Clients
> ---------------------------------------------
>                 Key: CXF-3617
>                 URL:
>             Project: CXF
>          Issue Type: Improvement
>          Components: JAX-RS
>            Reporter: Shaun Elliott
> Given the following interface:
> {code}
> @Path( "execute" )
> @Produces( "application/json" )
> MyObject execute( MyObject myObject );
> {code}
> One must provide MessageBodyReader\Writer or face the following exception:
> {code}
> Exception in thread "main" org.apache.cxf.interceptor.Fault: .No message body writer
found for class : class
>     at org.apache.cxf.jaxrs.client.ClientProxyImpl$BodyWriter.handleMessage(
>     at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(
>     at org.apache.cxf.jaxrs.client.ClientProxyImpl.doChainedInvocation(
>     at org.apache.cxf.jaxrs.client.ClientProxyImpl.invoke(
>     at $Proxy13.execute(Unknown Source)
>     at
> {code}
> Other competing libraries (such as Restlet) support automatic type mapping out of the
box via XStream and Jackson. Given CXF's compliance to JAX-RS it would be helpful if this
boilerplate type code were given out of the box too.
> See here for more information: 

This message is automatically generated by JIRA.
For more information on JIRA, see:


View raw message