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对象没有 空的构造器 

 加上 空的构造器即可。

feign.codec.DecodeException异常解决_第1张图片

你可能感兴趣的:(springCloud)