BeanCreationException: Error creating bean with name ‘configurationPropertiesBeans‘ defined in class

1 现象

启动 SpringCloud项目时报错。

2 解决方案

2.1 spring-cloud-dependencies添加到dependencyManagement标签

<dependencyManagement>
    <dependencies>
        <!--整合spring cloud-->
        <dependency>
            <groupId>org.springframework.cloud</groupId>
            <artifactId>spring-cloud-dependencies</artifactId>
            <version>Greenwich.SR1</version>
            <type>pom</type>
            <scope>import</scope>
        </dependency>

如若还不行,看第二步:

2.2 协作的 SpringBoot 版本

如果你是将spring cloud依赖引入SpringBoot项目,就需要spring boot版本和spring cloud版本应严格按照官方版本匹配。
官方网站链接:spring-cloud


笔者就是因为将低版本 sc 引入了高版本 sb 导致报错,升级 sc 版本即可。
参考:

  • https://stackoverflow.com/questions/69061913/beancreationexception-error-creating-bean-with-name-configurationpropertiesbea

猜你喜欢

转载自blog.csdn.net/qq_33589510/article/details/132817424