软件编程
位置:首页>> 软件编程>> java编程>> 关于feign.codec.DecodeException异常的解决方案

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

作者:熊熊爱绵羊  发布时间:2022-01-28 15:50:19 

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

 加上 空的构造器即可。

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

解决错误Type definition error: [simple type, classXXX

类上面加

  • @AllArgsConstructor

  • @NoArgsConstructor

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

来源:https://blog.csdn.net/m0_37564404/article/details/99627205

0
投稿

猜你喜欢

手机版 软件编程 asp之家 www.aspxhome.com