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 to a Tomcat server. I use RESTeasy as a frame. When I try to access the service, I come across this:
Could not find MessageBodyWriter for the response object of type: java.util.LinkedHashMap of type media: application / json.
I did not understand what the problem was.
Thank you in advance
source share