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排除掉就好了;

SpringBoot LoggerFactory is not a Logback LoggerContext but Logback is on the classpath的更多相关文章

  1. springboot项目maven报错 LoggerFactory is not a Logback LoggerContext but Logback is on the classpath. Either remove Logback

    完整信息如下 SLF4J: Class path contains multiple SLF4J bindings.SLF4J: Found binding in [jar:file:/D:/deve ...

  2. LoggerFactory is not a Logback LoggerContext but Logback is on the classpath. Either remove Logback or the competing implementation

    2019-06-26 22:19:57.408642475 java.lang.IllegalArgumentException: LoggerFactory is not a Logback Log ...

  3. 安装springboot时遇到 LoggerFactory is not a Logback LoggerContext but Logback is on the classpath.问题

    将工程外部jar包删除slf4j就可以运行.

  4. 解决LoggerFactory is not a Logback LoggerContext but Logback is on the classpath

    因为引用了log4j2同时还引用了logback

  5. 【spring boot logback】日志logback格式解析

    日志logback格式解析 logback官网 格式解析 https://logback.qos.ch/manual/layouts.html#ClassicPatternLayout 官网格式解析有 ...

  6. springboot结合日志门面SLF4j和日志实现Logback的使用

    一.此处主要介绍在springboot工程下如何使用 logback + slf4j  进行日志记录. logback主要包含三个组成部分:Loggers(日志记录器).Appenders(输出目的在 ...

  7. 🔥SpringBoot图文教程2—日志的使用「logback」「log4j」

    有天上飞的概念,就要有落地的实现 概念+代码实现是本文的特点,教程将涵盖完整的图文教程,代码案例 文章结尾配套自测面试题,学完技术自我测试更扎实 概念十遍不如代码一遍,朋友,希望你把文中所有的代码案例 ...

  8. springboot中用来进行查看错误日志的logback文件

    <?xml version="1.0" encoding="UTF-8"?> <!-- 从高到地低 OFF . FATAL . ERROR . ...

  9. lombok+slf4j+logback SLF4J和Logback日志框架详解

    maven 包依赖 <dependency> <groupId>org.projectlombok</groupId> <artifactId>lomb ...

随机推荐

  1. Spring-boot内置的程序管理监控工具-Actuator

    1.引入jar包: <dependencies> <dependency> <groupId>org.springframework.boot</groupI ...

  2. DSP VLIB实验

    声明:引用请注明出处http://blog.csdn.net/lg1259156776/ 引言 在dsp开发中,为了节省开发时间和难度,TI将一些成熟的算法封装为模块,供开发者使用.如果能充分利用这些 ...

  3. 最新 游族网络java校招面经 (含整理过的面试题大全)

    从6月到10月,经过4个月努力和坚持,自己有幸拿到了网易雷火.京东.去哪儿.游族网络等10家互联网公司的校招Offer,因为某些自身原因最终选择了游族网络.6.7月主要是做系统复习.项目复盘.Leet ...

  4. XMemcached的基本使用

    XMemcached是memcached的一个java客户端,基于java nio,支持memcached的所有协议.本文简要介绍XMemcached的基本使用. 一.添加依赖 <depende ...

  5. JS中根据某个值进行大小排序

    //从大到小排序 function compareBigToSmall(property){ return function(a,b){ var value1 = a[property]; var v ...

  6. python线程定时器Timer(32)

    相对前面几篇python线程内容而言,本片内容相对比较简单,定时器 – 顾名思义,必然用于定时任务. 一.线程定时器Timer原理 原理比较简单,指定时间间隔后启动线程!适用场景:完成定时任务,例如: ...

  7. 乐字节Java|GC垃圾回收机制、package和import

    本文接上一篇:乐字节Java|this关键字.static关键字.block块.本文是接着讲述JavaGC垃圾回收机制.package 和 import语句. 一.GC垃圾回收机制 GC全名:Garb ...

  8. Servlet技术之——概述、实现、细节、获取资源、ServletConfig、ServletContext

    Servlet概述.实现.细节.获取资源.ServletConfig.ServletContext (一) Setvlet基本概述 (1) 什么是Servlet ? Servlet(Server Ap ...

  9. java读写cookie中文乱码解决方法

    1.写入的时候: public boolean addCookie( HttpServletRequest req, HttpServletResponse resp){ //创建 Cookie co ...

  10. Pywinauto使用方法

    3 Pywinauto使用 连接为 http://pywinauto.github.io/ 3.1 关联到一个应用,用以下方法: ? start_(path) connect_(handle or p ...