启动服务报错 java.lang.NoClassDefFoundError: org/springframework/boot/logging/DeferredLogFactory

启动服务报错
java.lang.NoClassDefFoundError: org/springframework/boot/logging/DeferredLogFactory

原因:创建项目后更改了springboot 版本,从 2.7.4 改为 2.2.4.RELEASE,导致 boot 与 cloud 版本不兼容,查看官网改成对应版本即可

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

"Hoxton.SR7": "Spring Boot >=2.2.0.M4 and <2.3.4.BUILD-SNAPSHOT"

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.4”:“Spring Boot >=2.6.1 and ❤️.0.0-M1”,
“2022.0.0-M1”:“Spring Boot >=3.0.0-M1 and ❤️.0.0-M2”,
“2022.0.0-M2”:“Spring Boot >=3.0.0-M2 and ❤️.0.0-M3”,
“2022.0.0-M3”:“Spring Boot >=3.0.0-M3 and ❤️.0.0-M4”,
“2022.0.0-M4”:“Spring Boot >=3.0.0-M4 and ❤️.1.0-M1”}

解决方法:将 cloud 版本改为 boot 兼容版本

如:Hoxton.SR12 、 Hoxton.SR7
这里选择改为 Hoxton.SR12

<properties>
    <java.version>1.8</java.version>
    <spring-cloud.version>Hoxton.SR12</spring-cloud.version>
</properties>

    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-web</artifactId>
        <version>2.2.4.RELEASE</version>
    </dependency>

        <!-- cloud 版本改为 Hoxton.SR12 即可 -->
        <dependency>
            <groupId>org.springframework.cloud</groupId>
            <artifactId>spring-cloud-dependencies</artifactId>
            <version>${spring-cloud.version}</version>
            <type>pom</type>
            <scope>import</scope>
        </dependency>
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值