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

  • 相关阅读:
    二维码生成代码
    部署javaweb项目到阿里云ecs(centos7)
    mysql基础知识
    IDEA快捷键快速补齐类和对象名
    Redis和elasticsearch
    在asp.net 项目的bin目录中使用子目录
    MVC项目引用备注
    OAuth相关备注
    手动安装windows的磁盘清理工具
    在CentOS上安装 MongoDB
  • 原文地址:https://www.cnblogs.com/yibao/p/14493861.html
Copyright © 2020-2023  润新知