SLF4J: Class path contains multiple SLF4J bindings

SLF4J: Class path contains multiple SLF4J bindings,第1张

SLF4J: Class path contains multiple SLF4J bindings

环境: *** 作系统window10,gradle 版本:gradle-6.8.3,IDE:IntelliJ IDEA 2019.3.4 x64

1、冲突原因:在使用springboot中,引入zookeeper 库时会出现日志库冲突问题,报SLF4J: Class path contains multiple SLF4J bindings错误,如图:

这是springboot中引入其他SLF4J库,同时zookeeper中也同样引入,但是版本不同,

可以将zookeeper中的日志库进行排除即可

2、排除zookeeper  org.slf4j

在build.gradle文件中的依赖项中引入zookeeper库时,剔除org.slf4jde 的引用

dependencies {

    implementation(group: 'org.apache.zookeeper', name: 'zookeeper', version: '3.7.0')
            {
                exclude group:'org.slf4j'
            }
}

欢迎分享,转载请注明来源:内存溢出

原文地址: http://outofmemory.cn/zaji/5717535.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-12-17
下一篇 2022-12-18

发表评论

登录后才能评论

评论列表(0条)

保存