0

Iam using Dynamic Web Project 2.5, Jersey and Tomcat 7.0 to create a Java Restful Webservice. I want to response JSON if someone request data. But i always get the following error from Tomcat:

enter image description here

That my configurations in relation to web.xml and annotations are ok is demonstrated by using xml instead of JSON. Then its working fine:

enter image description here

If i switch MediaType Notation from APPLICATION_XML to APPLICATION_JSON the error is thrown.

Iam using Chrome-Browser and i read that chrome just show a json-string if requested. I hope someone can help me. Thanks in advance.

Paul Samsotha
  • 205,037
  • 37
  • 486
  • 720
Sebi
  • 3,879
  • 2
  • 35
  • 62

1 Answers1

2

Seeing from your previous question, you seem to missing a provider for JSON/POJO support. You can see this answer for all the jars and dependencies you need to add to your project.

Note: The linked answer shows 2.17 jars for Jersey, but you are using 2.18. The answer also provides a link where you can download the version you need.

Community
  • 1
  • 1
Paul Samsotha
  • 205,037
  • 37
  • 486
  • 720