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

后端 未结 15 1915
说谎
说谎 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:40

    I know that this post is old and you figured this out a long time ago, but just to save the people who will read this some time.

    You probably forgot to add annotation to the entity you are passing to the endpoint, so Jersey does not know how to process the POJO it receives. Annotate the pojo with something like this:

    @XmlRootElement(name = "someName")
    

提交回复
热议问题