I have this REST service that returns JSON code :
@GET
@Path("/mypath")
@Produces(MediaType.APPLICATION_JSON)
public Response getS() {
Map<String, String> map = new LinkedHashMap<String, String>();
map.put(key1, val1);
map.put(key2, val2);
return Response.ok(map, MediaType.APPLICATION_JSON).build();
}
This service is deployed in a Tomcat server. I am using RESTeasy as framework. When trying to access the service, I encounter this:
Could not find MessageBodyWriter for response object of type: java.util.LinkedHashMap of media type: application/json.
I didn't understand what is the problem.
Thanks in advance
Map<String, String>
, instead of aResponse
object? – Flavio