webservice接口问题:Payload: No message body writer has been found for class domain, ContentType: application/xml

当在使用cxf-rs的webservice的时候,有时候在传输数据,会发生这种错误

错误代码:

Response-Code: 500
Content-Type: text/plain
Headers: {Content-Type=[application/xml], Date=[Thu, 10 Aug 2017 06:41:49 GMT]}
Payload: No message body writer has been found for class cn.itcast.bos.domain.base.Area, ContentType: application/xml

这是由于实体类上,没有配置@XmlRootElement注解,这样一来,webservice就没办法去把元素给解析成xml格式或者json格式了

原文地址:https://www.cnblogs.com/wangxinblog/p/7339612.html