环境: *** 作系统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' } }
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)