Jersey: MessageBodyWriter not found for media type=application/json, type=class org.codehaus.jackson.node.ObjectNode?

前端 未结 4 1132
无人及你
无人及你 2020-12-17 15:57

I am using Jersey 2.8 Client to post data to RESTful endpoint. The code looks like

    final Client client = ClientBuilder.newClient();
    fina         


        
4条回答
  •  挽巷
    挽巷 (楼主)
    2020-12-17 16:46

    I added a comment above stating that the addition of X had worked.

    However, adding the following maven dependency to the pom.xml works as well, and seems like a more standard fix.

         
            org.glassfish.jersey.media
            jersey-media-moxy
        
    

    Note: The org.glassfish.jersey.archetypes/jersey-quickstart-grizzly maven archetype adds the dependency above by default, but commented out with the comment "uncomment this to get JSON support".

提交回复
热议问题