spring boot 踩坑日记-Request processing failed; nested exception is feign.codec.DecodeException: Error w

错误信息:

"Request processing failed; nested exception is feign.codec.DecodeException: Error while extracting response for type [cn.silucaihong.scheduling.common.ResultBean<java.lang.Boolean>] and content type [application/json;charset=UTF-8]; nested exception is org.springframework.http.converter.HttpMessageNotReadableException: JSON parse error: Cannot construct instance of `cn.silucaihong.scheduling.common.ResultBean` (although at least one Creator exists): cannot deserialize from Object value (no delegate- or property-based Creator); nested exception is com.fasterxml.jackson.databind.exc.MismatchedInputException: Cannot construct instance of `cn.silucaihong.scheduling.common.ResultBean` (although at least one Creator exists): cannot deserialize from Object value (no delegate- or property-based Creator)\n at [Source: (PushbackInputStream); line: 1, column: 2]",

service control:

feign 接口:

注意我这样写是完全正确的

响应对象:

因为feign是通过http请求访问服务的所以可以不实现serializable接口

出现错误的原因是没有空的构造器,加上空的构造器就KO了

猜你喜欢

转载自blog.csdn.net/ityqing/article/details/84620669