I was in the same situation where
- I was not using Maven or Ant,
- I finished this Vogella tutorial on Jersey,
- and I was getting the MessageBodyWriter
error when trying to use @Produces(MediaType.APPLICATION_JSON)
.
This answer by @peeskillet solves the problem - you have to use the Jackson *.jar files that are available from the FasterXML Jackson Download page. You'll need the core
files as well as the jaxrs
files.
I added them to my WebContent/WEB-INF/lib
folder where I have my Jersey *.jar files per the above tutorial, and made the small change to the web.xml file below (again, as originally shared by @peeskillet):
<param-name>jersey.config.server.provider.packages</param-name>
<param-value>
your.other.package.here, com.fasterxml.jackson.jaxrs.json
</param-value>
The important part being com.fasterxml.jackson.jaxrs.json
.