cxf-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "adam.galloway" <adam.gallo...@scala.com>
Subject RE: JAX-RS response for POST and PUT no longer working
Date Tue, 24 Feb 2009 21:00:57 GMT

Thanks for your quick reply.  It looks like I found the issue, if the
incoming Json data is missing the root element ( {id:1} rather than {detail:
{id: 1}} etc.) then it throws that error about not finding a message body
writer. If the root element is there then it works fine.  

It's kind of a strange message for an input error, but thanks for you help. 
Playing with the request headers is what helped me find the poorly formatted
JSON.

Thanks again,

Adam


Sergey Beryozkin-2 wrote:
> 
> Hi
> 
> I hope not... We do have few tests which post and expect the response
> back, with the same type involved. 
> 
> Can you please provide few more details. 
> What are ContentType and Accept values ?  
>  
> Thanks, Sergey
> 
> -----Original Message-----
> From: adam.galloway [mailto:adam.galloway@scala.com] 
> Sent: 24 February 2009 19:04
> To: users@cxf.apache.org
> Subject: JAX-RS response for POST and PUT no longer working
> 
> 
> I have a JAX-RS service with create and update methods that return data
> objects rather than a JAX-RS Response object.
> 
> I am using the 2.2-SNAPSHOT and as of recently I get an error from my
> POST
> and PUT methods
> 
> @Path("my-service")
> public class MyService {
> 
> @WebMethod
> @POST
> @Path("/detail/")
> @Consumes("application/json")
> public Detail createDetail(Detail object) {
>    //create detail
>    return newDetail;
> }
> 
> @WebMethod
> @GET
> @Path("/detail/{id}")
> public Detail getDetail(@WebParam(name = "id") @PathParam("id") Long id)
> {
>   //find detail
>   return someDetail;
> }
> 
> }
> 
> The getDetail() method returns the object formatted in json or xml with
> no
> problem
> 
> The createDetail() method returns the following error:
> .No message body writer found for response class : Detail.
> 
> Is it likely that something in the SNAPSHOT was recently broken?
> -- 
> View this message in context:
> http://www.nabble.com/JAX-RS-response-for-POST-and-PUT-no-longer-working
> -tp22188279p22188279.html
> Sent from the cxf-user mailing list archive at Nabble.com.
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/JAX-RS-response-for-POST-and-PUT-no-longer-working-tp22188279p22190574.html
Sent from the cxf-user mailing list archive at Nabble.com.


Mime
View raw message