信息发布→ 登录 注册 退出

关于feign.codec.DecodeException异常的解决方案

发布时间:2026-01-11

点击量:
目录
  • feign.codec.DecodeException异常
  • 解决错误Type definition error: [simple type, classXXX

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

以上为个人经验,希望能给大家一个参考,也希望大家多多支持。

在线客服
服务热线

服务热线

4008888355

微信咨询
二维码
返回顶部
×二维码

截屏,微信识别二维码

打开微信

微信号已复制,请打开微信添加咨询详情!