美文网首页
springboot与springcloud版本关系,BeanC

springboot与springcloud版本关系,BeanC

作者: 木头左 | 来源:发表于2024-04-03 10:51 被阅读0次

    添加注解@EnableFeignClients后报错:

    org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'configurationPropertiesBeans' defined in class path resource [org/springframework/cloud/autoconfigure/ConfigurationPropertiesRebinderAutoConfiguration.class]: Post-processing of merged bean definition failed; nested exception is java.lang.IllegalStateException: Failed to introspect Class [org.springframework.cloud.context.properties.ConfigurationPropertiesBeans] from ClassLoader [sun.misc.Launcher$AppClassLoader@18b4aac2]

    • 原因:springboot与springcloud版本不一致
    • 版本依赖关系(推荐使用)

    { "git":{ "branch":"cfa2df2c0373b794c843dfffb19652293d3eb7b9", "commit":{ "id":"cfa2df2", "time":"2023-05-08T14:51:45Z" } }, "build":{ "version":"0.0.1-SNAPSHOT", "artifact":"start-site", "versions":{ "spring-boot":"3.0.6", "initializr":"0.20.0-SNAPSHOT" }, "name":"start.spring.io website", "time":"2023-05-08T14:52:52.478Z", "group":"io.spring.start" }, "bom-ranges":{ "codecentric-spring-boot-admin":{ "2.4.3":"Spring Boot >=2.3.0.M1 and <2.5.0-M1", "2.5.6":"Spring Boot >=2.5.0.M1 and <2.6.0-M1", "2.6.8":"Spring Boot >=2.6.0.M1 and <2.7.0-M1", "2.7.4":"Spring Boot >=2.7.0.M1 and <3.0.0-M1", "3.0.3":"Spring Boot >=3.0.0-M1 and <3.1.0-M1" }, "solace-spring-boot":{ "1.1.0":"Spring Boot >=2.3.0.M1 and <2.6.0-M1", "1.2.2":"Spring Boot >=2.6.0.M1 and <3.0.0-M1" }, "solace-spring-cloud":{ "1.1.1":"Spring Boot >=2.3.0.M1 and <2.4.0-M1", "2.1.0":"Spring Boot >=2.4.0.M1 and <2.6.0-M1", "2.3.2":"Spring Boot >=2.6.0.M1 and <3.0.0-M1" }, "spring-cloud":{ "Hoxton.SR12":"Spring Boot >=2.2.0.RELEASE and <2.4.0.M1", "2020.0.6":"Spring Boot >=2.4.0.M1 and <2.6.0-M1", "2021.0.0-M1":"Spring Boot >=2.6.0-M1 and <2.6.0-M3", "2021.0.0-M3":"Spring Boot >=2.6.0-M3 and <2.6.0-RC1", "2021.0.0-RC1":"Spring Boot >=2.6.0-RC1 and <2.6.1", "2021.0.7":"Spring Boot >=2.6.1 and <3.0.0-M1", "2022.0.0-M1":"Spring Boot >=3.0.0-M1 and <3.0.0-M2", "2022.0.0-M2":"Spring Boot >=3.0.0-M2 and <3.0.0-M3", "2022.0.0-M3":"Spring Boot >=3.0.0-M3 and <3.0.0-M4", "2022.0.0-M4":"Spring Boot >=3.0.0-M4 and <3.0.0-M5", "2022.0.0-M5":"Spring Boot >=3.0.0-M5 and <3.0.0-RC1", "2022.0.0-RC1":"Spring Boot >=3.0.0-RC1 and <3.0.0-RC2", "2022.0.0-RC2":"Spring Boot >=3.0.0-RC2 and <3.0.0", "2022.0.2":"Spring Boot >=3.0.0 and <3.1.0-M1" }, "spring-cloud-azure":{ "4.7.0":"Spring Boot >=2.5.0.M1 and <3.0.0-M1", "5.1.0":"Spring Boot >=3.0.0-M1 and <3.1.0-M1" }, "spring-cloud-gcp":{ "2.0.11":"Spring Boot >=2.4.0-M1 and <2.6.0-M1", "3.5.0":"Spring Boot >=2.6.0-M1 and <3.0.0-M1", "4.3.0":"Spring Boot >=3.0.0-M1 and <3.1.0-M1" }, "spring-cloud-services":{ "2.3.0.RELEASE":"Spring Boot >=2.3.0.RELEASE and <2.4.0-M1", "2.4.1":"Spring Boot >=2.4.0-M1 and <2.5.0-M1", "3.3.0":"Spring Boot >=2.5.0-M1 and <2.6.0-M1", "3.4.0":"Spring Boot >=2.6.0-M1 and <2.7.0-M1", "3.5.0":"Spring Boot >=2.7.0-M1 and <3.0.0-M1", "4.0.0":"Spring Boot >=3.0.0 and <3.1.0-M1" }, "spring-shell":{ "2.1.9":"Spring Boot >=2.7.0 and <3.0.0-M1", "3.0.3":"Spring Boot >=3.0.0 and <3.1.0-M1" }, "vaadin":{ "14.9.6":"Spring Boot >=2.1.0.RELEASE and <2.6.0-M1", "23.2.15":"Spring Boot >=2.6.0-M1 and <2.7.0-M1", "23.3.11":"Spring Boot >=2.7.0-M1 and <3.0.0-M1", "24.0.5":"Spring Boot >=3.0.0-M1 and <3.1.0-M1" }, "wavefront":{ "2.0.2":"Spring Boot >=2.1.0.RELEASE and <2.4.0-M1", "2.1.1":"Spring Boot >=2.4.0-M1 and <2.5.0-M1", "2.2.2":"Spring Boot >=2.5.0-M1 and <2.7.0-M1", "2.3.4":"Spring Boot >=2.7.0-M1 and <3.0.0-M1", "3.0.1":"Spring Boot >=3.0.0-M1 and <3.1.0-M1" } }, "dependency-ranges":{ "okta":{ "1.4.0":"Spring Boot >=2.2.0.RELEASE and <2.4.0-M1", "1.5.1":"Spring Boot >=2.4.0-M1 and <2.4.1", "2.0.1":"Spring Boot >=2.4.1 and <2.5.0-M1", "2.1.6":"Spring Boot >=2.5.0-M1 and <3.0.0-M1", "3.0.3":"Spring Boot >=3.0.0-M1 and <3.1.0-M1" }, "mybatis":{ "2.1.4":"Spring Boot >=2.1.0.RELEASE and <2.5.0-M1", "2.2.2":"Spring Boot >=2.5.0-M1 and <2.7.0-M1", "2.3.0":"Spring Boot >=2.7.0-M1 and <3.0.0-M1", "3.0.0":"Spring Boot >=3.0.0-M1" }, "pulsar":{ "0.2.0":"Spring Boot >=3.0.0 and <3.1.0-M1" }, "pulsar-reactive":{ "0.2.0":"Spring Boot >=3.0.0 and <3.1.0-M1" }, "camel":{ "3.5.0":"Spring Boot >=2.3.0.M1 and <2.4.0-M1", "3.10.0":"Spring Boot >=2.4.0.M1 and <2.5.0-M1", "3.13.0":"Spring Boot >=2.5.0.M1 and <2.6.0-M1", "3.17.0":"Spring Boot >=2.6.0.M1 and <2.7.0-M1", "3.20.4":"Spring Boot >=2.7.0.M1 and <3.0.0-M1", "4.0.0-M3":"Spring Boot >=3.0.0-M1 and <3.1.0-M1" }, "picocli":{ "4.7.0":"Spring Boot >=2.5.0.RELEASE and <3.1.0-M1" }, "open-service-broker":{ "3.2.0":"Spring Boot >=2.3.0.M1 and <2.4.0-M1", "3.3.1":"Spring Boot >=2.4.0-M1 and <2.5.0-M1", "3.4.1":"Spring Boot >=2.5.0-M1 and <2.6.0-M1", "3.5.0":"Spring Boot >=2.6.0-M1 and <2.7.0-M1" } } }

    查看spring-cloud-openfeign的pom.xml中spring-boot版本
    <dependency>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-autoconfigure</artifactId>
    <version>2.4.13</version>
    <scope>compile</scope>
    </dependency>

    将项目中的spring-boot也改为2.4.13

    查看spring-cloud-context,升到3.0.5

    还有其他服务,尽量保持一致

    整合的时候,各个服务使用的spring-boot版本最好保持一致,不然可能会出现未知错误。

    参考:

    https://mvnrepository.com/artifact/org.springframework.boot/spring-boot-starter-parent

    https://start.spring.io/actuator/info

    相关文章

      网友评论

          本文标题:springboot与springcloud版本关系,BeanC

          本文链接:https://www.haomeiwen.com/subject/besgtjtx.html