MessageBodyWriter not found for media type=application/json when returning JSON in REST web service with Jersey

后端 未结 5 1611
难免孤独
难免孤独 2020-12-19 16:20

I am trying to create a very simple REST service using Jersey. Here is the service code

@Path(\"/UserService\")
publ         


        
5条回答
  •  星月不相逢
    2020-12-19 16:47

    You need a json serializer on your class path to make this work.

    Just add jackson and jersey will use this in the writer. E.g. if you are using maven, add this to the pom.xml

    
      com.fasterxml.jackson.core
      jackson-core
      2.7.4
    
    

提交回复
热议问题