使用Feign是出现的问题

SpringCloud对Feign进行了增强兼容了SpringMVC的注解 ,我们在使用SpringMVC的注解时需要注意:
1、feignClient接口 有参数在参数必须加@PathVariable(“XXX”)和@RequestParam(“XXX”)
2、feignClient返回值为复杂对象时其类型必须有无参构造函数。

com.fasterxml.jackson.databind.exc.InvalidDefinitionException: Cannot construct instance of `com.lxw
按住ctrl点击打开 返回值类型 类。
com.fasterxml.jackson.databind.exc.InvalidDefinitionException: Cannot construct instance of `com.lxw
1.在返回值类型中加上@NoArgsConstructor注解
2.进行序列化,方便传输

相关文章:

  • 2021-04-29
  • 2022-01-24
  • 2021-10-07
  • 2021-12-23
  • 2022-01-06
  • 2022-12-23
  • 2022-01-29
  • 2022-12-23
猜你喜欢
  • 2021-08-04
  • 2022-12-23
  • 2021-08-19
  • 2022-02-06
  • 2022-12-23
  • 2021-10-20
  • 2021-12-09
相关资源
相似解决方案