Jersey + Json media type application/json was not found
Add the following dependency to solve the problem
"javax.ws.rs.WebApplicationException: com.sun.jersey.api.MessageException: A message body writer for Java class com.test.Jsonexample, and Java type class com.test.Jsonexample, and MIME media type application/json was not found
at com.sun.jersey.spi.container.ContainerResponse.write(ContainerResponse.java:285)"
Solution :
<dependency>
<groupId>com.sun.jersey</groupId>
<artifactId>jersey-bundle</artifactId>
<version>1.18</version>
</dependency>
Fixed issue by adding the following to my pom.xml:
<dependency>
<groupId>com.owlike</groupId>
<artifactId>genson</artifactId>
<version>0.99</version>
</dependency>
Documentation can be found at: https://code.google.com/p/genson/
This problem is fixed with jersey-bundle-1.8.jar
First of all if your @POST
web-service returns a response you must add @Produces
annotation.
Ensure that jersey-json
lib is in your classpath.
Try removing the toString()
method because it may broke the beans structure format.