在 nacos、sentinel 集成 Feign 的时候,报出以下错误
从依赖中可以看到这个类位于 spring-cloud-commons包内

此时我的 Feign 没有指定版本,就会直接引用 cloud alibaba 的版本号
| Spring Cloud Alibaba | Spring Cloud | Spring Boot | Sentinel Version | Nacos Version |
|---|---|---|---|---|
| 2.2.6.RELEASE | Spring Cloud Hoxton.SR9 | 2.3.2.RELEASE | 1.8.1 | 1.4.2 |
在网上各种寻找,都说是版本的问题
说有可能是 openfeign 与 nacos 中的 common包版本出现不一致的冲突,但是我这里两个版本是一样的,如下:

最后我在 pom 文件里面新增依赖
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-loadbalancer</artifactId>
</dependency>
突然就好了。。。
在集成Nacos、Sentinel和Feign时遇到类找不到的错误,尽管排除了版本不匹配的可能性,问题依然存在。通过添加`spring-cloud-starter-loadbalancer`依赖,成功解决了该问题,使得Feign能够正常工作。
2155

被折叠的 条评论
为什么被折叠?



