记录一次SpringCloud Alibaba整合Springboot出现的'com.netflix.client.config.IClientConfig' that could not be found


版本:

            <dependency>
                <groupId>org.springframework.cloud</groupId>
                <artifactId>spring-cloud-dependencies</artifactId>
                <version>Greenwich.SR3</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>

            <dependency>
                <groupId>com.alibaba.cloud</groupId>
                <artifactId>spring-cloud-alibaba-dependencies</artifactId>
                <version>2.1.1.RELEASE</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>

Nacos:

1.1.4

启动报错信息:

Parameter 0 of method ribbonServerList in com.alibaba.cloud.nacos.ribbon.NacosRibbonClientConfiguration required a bean of type 'com.netflix.client.config.IClientConfig' that could not be found.

 

 

 

找不到这个IClientConfig的文件。

但是我只是引入了依赖,甚至连@EnableDiscoveryClient注解都没加,我直接启动SpringBoot项目,启动失败,报如上的错。

SpringBoot启动类是放在com.XXX包下的。

后来,我将SpringBoot的启动类移动到com包下,启动,问题解决了。

这应该是个Bug,按理说只要SpringBoot启动类只要放在com包下就可以,而且SpringBoot官网还推荐放在com主目录下的嘞。不知道SpringCloudAlibaba在后面的版本有没有修复这个bug。。。


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM