SpringBoot 在启动项目的时候一起错误:

SLF4J: Class path contains multiple SLF4J bindings.
SLF4J: Found binding in [jar:file:/Users/tongqinyuan/.m2/repository/org/slf4j/slf4j-log4j12/1.7.25/slf4j-log4j12-1.7.25.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [jar:file:/Users/tongqinyuan/.m2/repository/ch/qos/logback/logback-classic/1.2.3/logback-classic-1.2.3.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 [org.slf4j.impl.Log4jLoggerFactory]
Exception in thread "main" java.lang.IllegalArgumentException: LoggerFactory is not a Logback LoggerContext but Logback is on the classpath. Either remove Logback or the competing implementation (class org.slf4j.impl.Log4jLoggerFactory loaded from file:/Users/tongqinyuan/.m2/repository/org/slf4j/slf4j-log4j12/1.7.25/slf4j-log4j12-1.7.25.jar). If you are using WebLogic you will need to add 'org.slf4j' to prefer-application-packages in WEB-INF/weblogic.xml: org.slf4j.impl.Log4jLoggerFactory

其实这是slf4j 日志包冲出导致 ,怎么查看包冲突呢?

zookeeper包和junit包中都引入了日志包:

<dependency>
<groupId>org.apache.zookeeper</groupId>
<artifactId>zookeeper</artifactId>
<exclusions>
<exclusion>
<artifactId>slf4j-log4j12</artifactId>
<groupId>org.slf4j</groupId>
</exclusion>
</exclusions>
</dependency>
安装maven help 插件,在pom.xml文件下点击dependency Analyzer分析查看冲突的包

找到冲突后通过exclude排除掉就好了;

最新文章

  1. iOS报错[__NSCFNumber length]: unrecognized
  2. java-并发-不可变对象
  3. px与rem关系及转换
  4. TF-IDF 加权及其应用
  5. angular入门系列教程1
  6. WCF - IIS Hosting
  7. Kickstart + http Linux自动化部署服务端
  8. Android studio mac版本快捷键
  9. c++ map unordered_map
  10. 解析 .Net Core 注入 (3) 创建对象
  11. Activiti 5.22.0 之自由驳回任务实现(亲测)
  12. Vegas Pro 15软件界面对比
  13. 通过修改配置文件修改MySQL的时区设置
  14. json信息的后台到前台的传输
  15. php魔术方法__tostring的应用
  16. OpenCV——查找、绘制轮廓
  17. mysql/mariadb学习过程中出现的问题与解决
  18. 【转】Java常量池详解
  19. appium+python自动化26-模拟手势点击坐标(tap)
  20. Time Zone 【模拟时区转换】(HDU暑假2018多校第一场)

热门文章

  1. Unity与Android刘海屏适配
  2. 并查集与最小生成树Kruskal算法
  3. 微信H5支付开发全过程(除内置微信以外的浏览器)
  4. Java面试 - 重载(Overload)和重写(Override)的区别?
  5. CNN-1: LeNet-5 卷积神经网络模型
  6. Oracle游标的简易用法
  7. Word 查找替换高级玩法系列之 -- 给数字批量添加空格和下划线
  8. C++:链表(有头链表)
  9. Gossip协议
  10. B-JUI文档、下载