You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cxf.apache.org by asotobu <as...@gmail.com> on 2015/04/09 10:08:28 UTC
JsonValue and Malformed Json
Hi I am developing an application with Apache CXF 3.0.3. Currently I have two
endpoints, to simplify:
@GET
@Produces(MediaType.APPLICATION_JSON)
public Response movies() {
List<javax.json.JsonValue> movies = moviesService.findMovies();
return Response.ok(movies.get(0)).build();
}
This first endpoint works well and it returns a json document, but if I do
next:
@GET
@Produces(MediaType.APPLICATION_JSON)
public Response movies() {
List<JsonValue> movies = moviesService.findMovies();
GenericEntity<List<JsonValue>> list = new
GenericEntity<List<JsonValue>>(movies) {
};
return Response.ok(list).build();
}
Note that I am creating a GenericEntity of list of JsonValue (which as we
have seen in previous endpoint), cxf knows how to serialize. But I receive
next error:
No message body writer has been found for class java.util.Arrays$ArrayList,
ContentType: application/json
I don't know if I am doing something wrong or I am missing something but
this should work isn't it? Curently I am using CXF with TomEE 2.
Thank you so much.
--
View this message in context: http://cxf.547215.n5.nabble.com/JsonValue-and-Malformed-Json-tp5755815.html
Sent from the cxf-user mailing list archive at Nabble.com.