Jersey Exception : SEVERE: A message body reader for Java class
To make it work you only need two things. Check if you are missing:
- First of all, you need @XmlRootElement annotation for your object class/entity.
You need to add dependency for jersey-json if you are missing.For your reference I added this dependency into my pom.xml.
<dependency> <groupId>com.sun.jersey</groupId> <artifactId>jersey-json</artifactId> <version>1.17.1</version> </dependency>
just put this
<init-param>
<param-name>com.sun.jersey.api.json.POJOMappingFeature</param-name>
<param-value>true</param-value>
</init-param>
I was able to fix the issue by adding the maven dependency for jersey-json.