SEVERE: MessageBodyWriter not found for media type=application/json, type=…

If you’re trying to produce JSON content using JAX-RS (Jersey) and you’re getting this error:

[code]
SEVERE: MessageBodyWriter not found for media type=application/json, type=class …, genericType=class …
[/code]

This means that you are missing a JSON library in your classpath. Jackson is one I’m using so adding this to your pom.xml will help:

[code language=”xml”]
<dependency>
<groupId>org.glassfish.jersey.media</groupId>
<artifactId>jersey-media-json-jackson</artifactId>
<version>2.10.1</version>
</dependency>
[/code]

Leave a Reply

Your email address will not be published. Required fields are marked *