MessageBodyReader not found for media type=application/json

后端 未结 8 1655
一生所求
一生所求 2020-12-15 17:10

I have wrote a JAX-RS server and client both use Jersey. I want to sent a collection of my entities to client and I made this steps:

  1. Made entity extends Serial
8条回答
  •  孤街浪徒
    2020-12-15 17:41

    Check if you are registering the media type for JSON support. Do you have jersey-media-moxy on your class-path? If not, add this dependency to your pom.xml, please check your jersey version, in this example I'm using Jersey 2 (2.24)

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

提交回复
热议问题