好得很程序员自学网

<tfoot draggable='sEl'></tfoot>

关于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

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

原文链接:https://blog.csdn.net/m0_37564404/article/details/99627205

查看更多关于关于feign.codec.DecodeException异常的解决方案的详细内容...

  阅读:24次