关于feign.codec.DecodeException异常的解决方案
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对象没有 空的构造器
加上 空的构造器即可。

解决错误Type definition error: [simple type, classXXX
类上面加
@AllArgsConstructor@NoArgsConstructor

以上为个人经验,希望能给大家一个参考,也希望大家多多支持脚本之家。
相关文章
SpringBoot自定义FailureAnalyzer过程解析
这篇文章主要介绍了SpringBoot自定义FailureAnalyzer,文中通过示例代码介绍的非常详细,对大家的学习或者工作具有一定的参考学习价值,需要的朋友可以参考下2019-11-11


最新评论