Jersey + Json media type application/json was not found

前端 未结 15 1057
轻奢々
轻奢々 2020-12-06 01:03

I am trying with simple Jersey + JSON example but I get following error message body writer for Java class com.test.jsonexample and MIME media type application/json w

15条回答
  •  不知归路
    2020-12-06 01:40

    Add the following dependency to solve the problem

    "javax.ws.rs.WebApplicationException: com.sun.jersey.api.MessageException: A message body writer for Java class com.test.Jsonexample, and Java type class com.test.Jsonexample, and MIME media type application/json was not found
        at com.sun.jersey.spi.container.ContainerResponse.write(ContainerResponse.java:285)"
    

    Solution :

    
        com.sun.jersey
        jersey-bundle
        1.18
    
    

提交回复
热议问题