feign.codec.DecodeException異常解決

在微服務項目使用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對象沒有 空的構造器 

 加上 空的構造器即可。

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章