MessageBodyWriter not found for media type=application/json

后端 未结 10 1640
庸人自扰
庸人自扰 2020-11-30 02:13

I am facing issues while consuming JAX-RS services as JSON.

Below I have added my code.

This is my service class:

//Sets the path to base URL         


        
10条回答
  •  被撕碎了的回忆
    2020-11-30 02:45

    To overcome this issue try the following. Worked for me.

    Add following dependency in the pom.xml

    
      org.glassfish.jersey.media
      jersey-media-json-jackson
      2.25
    
    

    And make sure Model class contains no arg constructor

     public Student()
        {
        }
    

提交回复
热议问题