记录一次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。。。

posted @ 2021-03-07 10:50  Java民工陆小凤  阅读(1788)  评论(0编辑  收藏  举报