当在使用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格式了

posted on 2017-08-10 15:35  博客王大锤  阅读(2452)  评论(0编辑  收藏  举报