Jersey Exception : SEVERE: A message body reader for Java class
Solution 1:
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>
Solution 2:
I was able to fix the issue by adding the maven dependency for jersey-json.