There is a correct answer to this question already on this site. The problem is that the question is for Jersey 1.6 and the correct answer for Jersey 1.17.1 is buried at the bottom. I figured I'd create a correct question for this answer so that it'd be easier to find help for people struggling with this (like I was).
相关问题
- Jackson Deserialization not calling deserialize on
- Design RESTful service with multiple ids
- Axios OPTIONS instead of POST Request. Express Res
- Plain (non-HTML) error pages in REST api
- Laravel 5.1 MethodNotAllowedHttpException on store
相关文章
- Got ActiveRecord::AssociationTypeMismatch on model
- Multiple parameters in AngularJS $resource GET
- Global Exception Handling in Jersey & Spring?
- REST search interface and the idempotency of GET
- Getting error detail from WCF REST
- Send a GET request with a body in JavaScript (XMLH
- GuzzleHttp Hangs When Using Localhost
- Spring 4.3.7 is throwing java.lang.NoClassDefFound
First, you need to add this to your web.xml:
Then, take any of the classes you want to serialize across the wire and add this annotation to the top of them:
Then add the appropriate jars to the classpath. It's not enough to add the Jersey jars, you also need to add jackson. I downloaded the zip that includes 12 different jars. Once I added all 12 jars to my classpath I finally got rid of the error and works great returning JSON.
I hope this helps somebody.
Download Zip with 12 Jars: Here is a link to the zip file that contains the 12 jar files: jersey-archive-1.17.zip
For Maven Users: Add the following to your pom.xml to get the 12 jars individually: