1. 程式人生 > >spring boot 踩坑日記-Request processing failed; nested exception is feign.codec.DecodeException: Error w

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了