当前位置:   article > 正文

使用Feign报错no suitable HttpMessageConverter found for response type[xxx]_no suitable found for response

no suitable found for response

使用Feign报错no suitable HttpMessageConverter found for response type [xx]…

本人也是刚刚学习springcloud,难免各种踩坑。今天我跟大家分享下我遇到的这个问题。微服务项目里一个模块通过Feign调用另一个模块报错。我直接说问题产生的原因吧。微服务项目我使用的网关是GateWay,GateWay的web依赖和Feign的web依赖会产生冲突,导致响应结果无法解析这种问题。

## 解决办法
把使用Feign的模块的pom文件中所有有关gateWay的依赖去掉。

先说一下我这个程序只写value会报404,目前还没解决,所以我在后面使用了url,有大佬知道是为什么欢迎给我留言。后边这个url一定也不要写GateWay网关的端口号,只需要写该模块启动的端口号即可。

@Component
@FeignClient(value = "USER-SERVICE",url = "http://localhost:8001/user")
public interface UserFeign {
    @GetMapping("/GET/allUsers")
    List<User> getUsers();
}
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
声明:本文内容由网友自发贡献,转载请注明出处:【wpsshop博客】
推荐阅读
相关标签
  

闽ICP备14008679号