Fork me on GitHub

SpringBoot A component required a bean of type 'XXXX' that could not be found

SpringBoot  A component required a bean of type 'XXXX' that could not be found


 

一、问题现象

SpingBoot 启动报错: A component required a bean of type 'XXXX' that could not be found

 

二、解决方案

1、pom.xml 增加 openfign   和 loadbalancer 的引用                              

<!--OpenFeign-->
        <dependency>
            <groupId>org.springframework.cloud</groupId>
            <artifactId>spring-cloud-starter-openfeign</artifactId>
            <version>3.1.1</version>
        </dependency>

        <!--spring-cloud-loadbalancer-->
        <dependency>
            <groupId>org.springframework.cloud</groupId>
            <artifactId>spring-cloud-loadbalancer</artifactId>
            <version>3.1.1</version>
        </dependency>

 

2、在XXXApplication启动类上增加  @EnableFeignClients

 

posted @ 2023-02-16 11:06  龙凌云端  阅读(1467)  评论(0编辑  收藏  举报