在 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>
突然就好了。。。