Jersey Exception : SEVERE: A message body reader for Java class

后端 未结 15 1939
说谎
说谎 2020-11-29 11:08

I have a Jersey based Rest WS which outputs JSON. I am implementing a Jersey Client to invoke the WS and consume the JSON response. The client code I have is below



        
15条回答
  •  情书的邮戳
    2020-11-29 11:43

    To make it work you only need two things. Check if you are missing:

    1. First of all, you need @XmlRootElement annotation for your object class/entity.
    2. You need to add dependency for jersey-json if you are missing.For your reference I added this dependency into my pom.xml.

      
          com.sun.jersey
          jersey-json
          1.17.1
      
      

提交回复
热议问题