Jersey: A message body writer for Java Class and MIME mediatype application/json was not found Jersey: A message body writer for Java Class and MIME mediatype application/json was not found json json

Jersey: A message body writer for Java Class and MIME mediatype application/json was not found


Try adding Genson library to your classpath http://owlike.github.io/genson/.It is a json<>java streaming and databinding api. It integrates well with jersey, to get you running you need 0 configuration. Jersey detects that the library is in your classpath and enables json mapping by delegating to Genson.


Include this dependencies in your POM.xml and run Maven -> Update

<dependency>    <groupId>com.sun.jersey</groupId>    <artifactId>jersey-json</artifactId>    <version>1.18.1</version></dependency><dependency>   <groupId>com.owlike</groupId>   <artifactId>genson</artifactId>   <version>0.99</version></dependency>


Adding below dependency solved my issue. As per @eugen I tried adding Genson dependency which helped get rid of the exception, however my server was throwing 400 bad request for some reason. It seems like Genson was not able to stream the json request properly. But below dependency worked fine. Hope it helps others as this problem was driving me nuts!

<dependency>  <groupId>com.fasterxml.jackson.jaxrs</groupId>  <artifactId>jackson-jaxrs-json-provider</artifactId>  <version>2.3.0</version></dependency>