org.glassfish.jersey.message.internal.WriterInterceptorExecutor: MessageBodyWriter not found for media type=application/json, type=class xxxxx
搜索了解决方式两三天,网上的方案都不能解决,后来在不断浏览帖子时,看到这个帖子:
https://stackoverflow.com/questions/26207252/messagebodywriter-not-found-for-media-type-application-json/33756603#33756603
的其中一个评论:
即先调用Gson().toJson();
把对象转换成jsonString,然后使用这个jsonString即可,这样就不用给jersey框架转递实体类的对象了,传递的是一个字符串。
MessageBodyWriter not found for media type=application/json
MessageBodyWriter not found for media type application/json when using MOXy #3235
how to send json object from REST client using javax.ws.rs.client.WebTarget
Jersey 与springMVC集成无法输出XML格式 报 MessageBodyWriter not found for media type=application/xml的解决办法