在微服務項目使用Feign進行遠程服務調用時,出現該異常:
feign.codec.DecodeException: Type definition error: [simple type, class entity.Result]; nested exception is com.fasterxml.jackson.databind.exc.InvalidDefinitionException: Cannot construct instance of `entity.Result` (no Creators, like default construct, exist): cannot deserialize from Object value (no delegate- or property-based Creator)
at [Source: (PushbackInputStream); line: 1, column: 2]
報該錯的原因是 構造的Result對象沒有 空的構造器
加上 空的構造器即可。