spring cloud 服务之间相互调用出错。

 

报错信息:

feign.codec.DecodeException: JSON parse error: Can not construct instance of com.mmtvip.message.ResponseMessage: no String-argument constructor/factory method to deserialize from String value ('无效请求!'); nested exception is com.fasterxml.jackson.databind.JsonMappingException: Can not construct instance of com.mmtvip.message.ResponseMessage: no String-argument constructor/factory method to deserialize from String value ('无效请求!')
 at [Source: java.io.PushbackInputStream@41233828; line: 1, column: 1]

 

 

解决方案:

将接口改为POST请求

@PostMapping("/xzh)

 

Logo

旨在为数千万中国开发者提供一个无缝且高效的云端环境,以支持学习、使用和贡献开源项目。

更多推荐