0
点赞
收藏
分享

微信扫一扫

springboot 2.6.x 启动报错 Class path contains multiple SLF4J bindings的解决

香小蕉 2022-02-01 阅读 59

问题描述

SLF4J: Class path contains multiple SLF4J bindings.
SLF4J: Found binding in [jar:file:/D:/maven/repository/ch/qos/logback/logback-classic/1.2.10/logback-classic-1.2.10.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [jar:file:/D:/maven/repository/org/slf4j/slf4j-log4j12/1.6.4/slf4j-log4j12-1.6.4.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation.
SLF4J: Actual binding is of type [ch.qos.logback.classic.util.ContextSelectorStaticBinder]

在这里插入图片描述

原因分析:

slf4j-log4j12 包与 spring-boot-starter-test 自带的包冲突

问题解决:排除其中一个的依赖

    <dependency>
        <groupId>org.slf4j</groupId>
        <artifactId>slf4j-log4j12</artifactId>
        <version>1.6.4</version>
    </dependency>

再次启动 无报错警告发生,错误排除
在这里插入图片描述

举报

相关推荐

0 条评论