You can use @XmlRootElement
if you want to use JAXB annotations (see other answers).
However, if you prefer pure POJO mapping, you must do the following (Unfortunately it isn’t written in docs):
- Add jackson*.jar to your classpath (As stated by @Vitali Bichov);
- In web.xml, if you’re using
com.sun.jersey.config.property.packages
init parameter, addorg.codehaus.jackson.jaxrs
to the list. This will include JSON providers in the scan list of Jersey.