Springboot项目log4j与logback的Jar包冲突问题
异常信息关键词:
SLF4J: Class path contains multiple SLF4J bindings.
ERROR in ch.qos.logback.core.joran.spi.Interpreter@24:14 - no applicable action for [properties], current ElementPath is [[configuration][properties]]
详细异常信息:
Connected to the target VM, address: '127.0.0.1:52687', transport: 'socket'
SLF4J: Class path contains multiple SLF4J bindings.
SLF4J: Found binding in [jar:file:/C:/Users/xx/.m2/repository/ch/qos/logback/logback-classic/1.2.11/logback-classic-1.2.11.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [jar:file:/C:/Users/xx/.m2/repository/org/apache/logging/log4j/log4j-slf4j-impl/2.17.2/log4j-slf4j-impl-2.17.2.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]
Logging system failed to initialize using configuration from 'classpath:log4j2.xml'
java.lang.IllegalStateException: Logback configuration error detected:
ERROR in ch.qos.logback.core.joran.spi.Interpreter@24:14 - no applicable action for [properties], current ElementPath is [[configuration][properties]]
ERROR in ch.qos.logback.core.joran.spi.Interpreter@26:29 - no applicable action for [property], current ElementPath is [[configuration][properties][property]]
ERROR in ch.qos.logback.core.joran.spi.Interpreter@28:31 - no applicable action for [property], current ElementPath is [[configuration][properties][property]]
ERROR in ch.qos.logback.core.joran.spi.Interpreter@29:33 - no applicable action for [property], current ElementPath is [[configuration][properties][property]]
ERROR in ch.qos.logback.core.joran.spi.Interpreter@30:36 - no applicable action for [property], current ElementPath is [[configuration][properties][property]]
ERROR in ch.qos.logback.core.joran.spi.Interpreter@32:13 - no applicable action for [appenders], current ElementPath is [[configuration][appenders]]
ERROR in ch.qos.logback.core.joran.spi.Interpreter@34:47 - no applicable action for [Console], current ElementPath is [[configuration][appenders][Console]]
ERROR in ch.qos.logback.core.joran.spi.Interpreter@37:71 - no applicable action for [ThresholdFilter], current ElementPath is [[configuration][appenders][Console][ThresholdFilter]]
ERROR in ch.qos.logback.core.joran.spi.Interpreter@38:44 - no applicable action for [PatternLayout], current ElementPath is [[configuration][appenders][Console][PatternLayout]]
ERROR in ch.qos.logback.core.joran.spi.Interpreter@47:79 - no applicable action for [RollingFile], current ElementPath is [[configuration][appenders][RollingFile]]
ERROR in ch.qos.logback.core.joran.spi.Interpreter@48:44 - no applicable action for [PatternLayout], current ElementPath is [[configuration][appenders][RollingFile][PatternLayout]]
ERROR in ch.qos.logback.core.joran.spi.Interpreter@49:14 - no applicable action for [Policies], current ElementPath is [[configuration][appenders][RollingFile][Policies]]
ERROR in ch.qos.logback.core.joran.spi.Interpreter@53:46 - no applicable action for [SizeBasedTriggeringPolicy], current ElementPath is [[configuration][appenders][RollingFile][Policies][SizeBasedTriggeringPolicy]]
ERROR in ch.qos.logback.core.joran.spi.Interpreter@56:39 - no applicable action for [DefaultRolloverStrategy], current ElementPath is [[configuration][appenders][RollingFile][DefaultRolloverStrategy]]
ERROR in ch.qos.logback.core.joran.spi.Interpreter@59:11 - no applicable action for [loggers], current ElementPath is [[configuration][loggers]]
ERROR in ch.qos.logback.core.joran.spi.Interpreter@61:80 - no applicable action for [Logger], current ElementPath is [[configuration][loggers][Logger]]
ERROR in ch.qos.logback.core.joran.spi.Interpreter@62:33 - no applicable action for [appender-ref], current ElementPath is [[configuration][loggers][Logger][appender-ref]]
ERROR in ch.qos.logback.core.joran.spi.Interpreter@64:109 - no applicable action for [Logger], current ElementPath is [[configuration][loggers][Logger]]
ERROR in ch.qos.logback.core.joran.spi.Interpreter@65:33 - no applicable action for [appender-ref], current ElementPath is [[configuration][loggers][Logger][appender-ref]]
ERROR in ch.qos.logback.core.joran.spi.Interpreter@67:81 - no applicable action for [Logger], current ElementPath is [[configuration][loggers][Logger]]
ERROR in ch.qos.logback.core.joran.spi.Interpreter@68:33 - no applicable action for [appender-ref], current ElementPath is [[configuration][loggers][Logger][appender-ref]]
ERROR in ch.qos.logback.core.joran.spi.Interpreter@71:79 - no applicable action for [Logger], current ElementPath is [[configuration][loggers][Logger]]
ERROR in ch.qos.logback.core.joran.spi.Interpreter@72:33 - no applicable action for [appender-ref], current ElementPath is [[configuration][loggers][Logger][appender-ref]]
ERROR in ch.qos.logback.core.joran.spi.Interpreter@74:71 - no applicable action for [Logger], current ElementPath is [[configuration][loggers][Logger]]
ERROR in ch.qos.logback.core.joran.spi.Interpreter@75:33 - no applicable action for [appender-ref], current ElementPath is [[configuration][loggers][Logger][appender-ref]]
ERROR in ch.qos.logback.core.joran.spi.Interpreter@77:87 - no applicable action for [Logger], current ElementPath is [[configuration][loggers][Logger]]
ERROR in ch.qos.logback.core.joran.spi.Interpreter@78:33 - no applicable action for [appender-ref], current ElementPath is [[configuration][loggers][Logger][appender-ref]]
ERROR in ch.qos.logback.core.joran.spi.Interpreter@80:88 - no applicable action for [Logger], current ElementPath is [[configuration][loggers][Logger]]
ERROR in ch.qos.logback.core.joran.spi.Interpreter@81:33 - no applicable action for [appender-ref], current ElementPath is [[configuration][loggers][Logger][appender-ref]]
ERROR in ch.qos.logback.core.joran.spi.Interpreter@83:80 - no applicable action for [Logger], current ElementPath is [[configuration][loggers][Logger]]
ERROR in ch.qos.logback.core.joran.spi.Interpreter@84:77 - no applicable action for [Logger], current ElementPath is [[configuration][loggers][Logger]]
ERROR in ch.qos.logback.core.joran.spi.Interpreter@85:33 - no applicable action for [appender-ref], current ElementPath is [[configuration][loggers][Logger][appender-ref]]
ERROR in ch.qos.logback.core.joran.spi.Interpreter@87:84 - no applicable action for [Logger], current ElementPath is [[configuration][loggers][Logger]]
ERROR in ch.qos.logback.core.joran.spi.Interpreter@88:77 - no applicable action for [Logger], current ElementPath is [[configuration][loggers][Logger]]
ERROR in ch.qos.logback.core.joran.spi.Interpreter@89:33 - no applicable action for [appender-ref], current ElementPath is [[configuration][loggers][Logger][appender-ref]]
ERROR in ch.qos.logback.core.joran.spi.Interpreter@92:55 - no applicable action for [Logger], current ElementPath is [[configuration][loggers][Logger]]
ERROR in ch.qos.logback.core.joran.spi.Interpreter@93:57 - no applicable action for [Logger], current ElementPath is [[configuration][loggers][Logger]]
ERROR in ch.qos.logback.core.joran.spi.Interpreter@94:65 - no applicable action for [Logger], current ElementPath is [[configuration][loggers][Logger]]
ERROR in ch.qos.logback.core.joran.spi.Interpreter@95:56 - no applicable action for [Logger], current ElementPath is [[configuration][loggers][Logger]]
ERROR in ch.qos.logback.core.joran.spi.Interpreter@96:64 - no applicable action for [Logger], current ElementPath is [[configuration][loggers][Logger]]
ERROR in ch.qos.logback.core.joran.spi.Interpreter@97:68 - no applicable action for [Logger], current ElementPath is [[configuration][loggers][Logger]]
ERROR in ch.qos.logback.core.joran.spi.Interpreter@98:64 - no applicable action for [Logger], current ElementPath is [[configuration][loggers][Logger]]
ERROR in ch.qos.logback.core.joran.spi.Interpreter@99:76 - no applicable action for [Logger], current ElementPath is [[configuration][loggers][Logger]]
ERROR in ch.qos.logback.core.joran.spi.Interpreter@100:72 - no applicable action for [Logger], current ElementPath is [[configuration][loggers][Logger]]
ERROR in ch.qos.logback.core.joran.spi.Interpreter@101:67 - no applicable action for [Logger], current ElementPath is [[configuration][loggers][Logger]]
ERROR in ch.qos.logback.core.joran.spi.Interpreter@102:52 - no applicable action for [Logger], current ElementPath is [[configuration][loggers][Logger]]
ERROR in ch.qos.logback.core.joran.spi.Interpreter@103:65 - no applicable action for [Logger], current ElementPath is [[configuration][loggers][Logger]]
ERROR in ch.qos.logback.core.joran.spi.Interpreter@104:66 - no applicable action for [Logger], current ElementPath is [[configuration][loggers][Logger]]
ERROR in ch.qos.logback.core.joran.spi.Interpreter@105:66 - no applicable action for [Logger], current ElementPath is [[configuration][loggers][Logger]]
ERROR in ch.qos.logback.core.joran.spi.Interpreter@106:62 - no applicable action for [Logger], current ElementPath is [[configuration][loggers][Logger]]
ERROR in ch.qos.logback.core.joran.spi.Interpreter@107:79 - no applicable action for [Logger], current ElementPath is [[configuration][loggers][Logger]]
ERROR in ch.qos.logback.core.joran.spi.Interpreter@110:61 - no applicable action for [Logger], current ElementPath is [[configuration][loggers][Logger]]
ERROR in ch.qos.logback.core.joran.spi.Interpreter@111:33 - no applicable action for [appender-ref], current ElementPath is [[configuration][loggers][Logger][appender-ref]]
ERROR in ch.qos.logback.core.joran.spi.Interpreter@112:29 - no applicable action for [appender-ref], current ElementPath is [[configuration][loggers][Logger][appender-ref]]
ERROR in ch.qos.logback.core.joran.spi.Interpreter@116:23 - no applicable action for [root], current ElementPath is [[configuration][loggers][root]]
ERROR in ch.qos.logback.core.joran.spi.Interpreter@117:33 - no applicable action for [appender-ref], current ElementPath is [[configuration][loggers][root][appender-ref]]
ERROR in ch.qos.logback.core.joran.spi.Interpreter@119:29 - no applicable action for [appender-ref], current ElementPath is [[configuration][loggers][root][appender-ref]]at org.springframework.boot.logging.logback.LogbackLoggingSystem.loadConfiguration(LogbackLoggingSystem.java:179)at org.springframework.boot.logging.AbstractLoggingSystem.initializeWithSpecificConfig(AbstractLoggingSystem.java:66)at org.springframework.boot.logging.AbstractLoggingSystem.initialize(AbstractLoggingSystem.java:57)at org.springframework.boot.logging.logback.LogbackLoggingSystem.initialize(LogbackLoggingSystem.java:132)at org.springframework.boot.context.logging.LoggingApplicationListener.initializeSystem(LoggingApplicationListener.java:332)at org.springframework.boot.context.logging.LoggingApplicationListener.initialize(LoggingApplicationListener.java:298)at org.springframework.boot.context.logging.LoggingApplicationListener.onApplicationEnvironmentPreparedEvent(LoggingApplicationListener.java:246)at org.springframework.boot.context.logging.LoggingApplicationListener.onApplicationEvent(LoggingApplicationListener.java:223)at org.springframework.context.event.SimpleApplicationEventMulticaster.doInvokeListener(SimpleApplicationEventMulticaster.java:176)at org.springframework.context.event.SimpleApplicationEventMulticaster.invokeListener(SimpleApplicationEventMulticaster.java:169)at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:143)at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:131)at org.springframework.boot.context.event.EventPublishingRunListener.environmentPrepared(EventPublishingRunListener.java:85)at org.springframework.boot.SpringApplicationRunListeners.lambda$environmentPrepared$2(SpringApplicationRunListeners.java:66)at java.util.ArrayList.forEach(ArrayList.java:1257)
异常信息告诉我们是jar包冲突导致,解决办法很简单,异常信息里面有个官网的地址,说明了解决方式,如下图:

访问地址:
http://www.slf4j.org/codes.html#multiple_bindings
传送门:SLF4J Error Codes
http://www.slf4j.org/codes.html#multiple_bindings
解决方式是指定使用的jar包,排除另一个不用的即可。
麻烦的是怎么找到导致jar冲突的依赖。
继续查看异常信息,提示了冲突的2个jar包的信息,如下截图:logback-classic和log4j-slf4j-impl。

查找jar依赖关系可以通过IDEA的maven插件,如下图直接搜索:
找到了相应的依赖包。
也可以通过树状结构查看,不如直接搜索来的直观:

或者通过maven命令查找:
dependency:tree -Dverbose -Dincludes=ch.qos.logback
找到导致冲突的依赖jar包,问题就好解决了,我这里是spring-boot-starter-test包导致的,直接排除springboot自带的logback即可,clean后运行项目可以正常启动了。
<dependency><groupId>org.springframework.boot</groupId><artifactId>spring-boot-starter-test</artifactId><scope>test</scope><!-- 排除自带的logback依赖 --><exclusions><exclusion><groupId>org.springframework.boot</groupId><artifactId>spring-boot-starter-logging</artifactId></exclusion></exclusions>
</dependency>
每个项目导致的原因可能各不相同,这是我遇到的一次jar包冲突供参考。
相关文章:
Springboot项目log4j与logback的Jar包冲突问题
异常信息关键词: SLF4J: Class path contains multiple SLF4J bindings. ERROR in ch.qos.logback.core.joran.spi.Interpreter24:14 - no applicable action for [properties], current ElementPath is [[configuration][properties]] 详细异常信息:…...
光伏并网逆变器低电压穿越技术研究(Simulink仿真)
💥💥💞💞欢迎来到本博客❤️❤️💥💥 🏆博主优势:🌞🌞🌞博客内容尽量做到思维缜密,逻辑清晰,为了方便读者。 ⛳️座右铭&a…...
命令模式,命令 Command 类对象的设计(设计模式与开发实践 P9)
文章目录 命令举例撤销C# 例子 命令 命令模式 Command 指的是一个 执行某些特定事情的指令 应用场景:有时需要向某些对象发送请求,但并不知道请求的接受者是谁,也不知道被请求的操作是什么。这时候命令模式就负责使发送者和接受者之间解耦 …...
jira 浏览器插件在问题列表页快速编辑问题标题
jira-issueTable-quicker 这是一个可以帮助我们在问题表格页快速编辑问题的浏览器插件 github 地址 功能介绍 jira 不可否认是一个可以帮助有效提高工作效率的工具,但是我们在使用 jira 时使用问题表格可以让我们看到跟多的内容而不用关注细节,但是目…...
2020架构真题(四十六)
、以下关于操作系统微内核架构特征的说法,不正确的是()。 微内核的系统结构清晰,利于协作开发微内核代码量少,系统具有良好的可移植性微内核有良好的的伸缩性和扩展性微内核功能代码可以互相调用,性能很高…...
软件工程与计算总结(五)软件需求基础
本帖介绍软件需求涉及的诸多基本概念,通过对这些概念的阐述,剖析软件需求的来源、层次、类别、作用等重要知识~ 目录 编辑 一.引言 二.需求工程基础 1.简介 2.活动 3.需求获取 4.需求分析 5.需求规格说明 6.需求验证 7.需求管理 三.需求基…...
数学建模预测模型MATLAB代码大合集及皮尔逊相关性分析(无需调试、开源)
已知2010-2020数据,预测2021-2060数据 一、Logistic预测人口 %%logistic预测2021-2060年结果 clear;clc; X[7869.34, 8022.99, 8119.81, 8192.44, 8281.09, 8315.11, 8381.47, 8423.50, 8446.19, 8469.09, 8477.26]; nlength(X)-1; for t1:nZ(t)(X(t1)-X(t))/X(t1…...
泛型擦除是什么?
泛型擦除的主要特点包括: 编译时类型检查:在编写泛型代码时,编译器会对泛型类型参数进行类型检查,以确保类型安全。这意味着在编译时会捕获许多类型错误,避免了运行时类型错误。因为泛型其实只是在编译器中实现的而虚拟…...
阿里云轻量应用服务器有月流量限制吗?
阿里云轻量应用服务器限制流量吗?部分限制,2核2G3M和2核4G4M这两款轻量应用服务器不限制月流量,其他的轻量服务器套餐有月流量限制。 腾讯云轻量应用服务器价格便宜,活动页面:aliyunbaike.com/go/tencent 细心的同学看…...
mysql面试题25:数据库自增主键可能会遇到什么问题?应该怎么解决呢?
该文章专注于面试,面试只要回答关键点即可,不需要对框架有非常深入的回答,如果你想应付面试,是足够了,抓住关键点 面试官:数据库自增主键可能会遇到什么问题? 数据库自增主键可能遇到的问题: 冲突问题:自增主键是通过自动递增生成的唯一标识符,但在某些情况下可能会…...
学习css 伪类:has
学习抖音: 渡一前端提薪课 首先我们看下:has(selector)是什么 匹配包含(相对于 selector 的 :scope)指定选择器的元素。可以认为 selector 的前面有一个看不见的 :scope 伪类。它的强大之处是,可以实现父选择器和前面兄弟选择器…...
矩阵的相似性度量的常用方法
矩阵的相似性度量的常用方法 1,欧氏距离 欧式距离是最易于理解的一种距离计算方法,源自欧式空间中两点间的距离公式。 (1)二维平面上的点 a ( x 1 , y 1 ) a(x_1,y_1) a(x1,y1)和点 b ( x 2 , y 2 ) b(x_2,y_2) b(x2,y2)的欧式距离为 d ( x …...
Java之TCP,UDP综合小练习一
4. 综合练习 练习一:多发多收 需求: 客户端:多次发送数据 服务器:接收多次接收数据,并打印 代码示例: public class Client {public static void main(String[] args) throws IOException {//客户端&…...
Docker 日志管理 - ELK
Author:rab 目录 前言一、Docker 日志驱动二、ELK 套件部署三、Docker 容器日志采集3.1 部署 Filebeat3.2 配置 Filebeat3.3 验证采集数据3.4 Kibana 数据展示3.4.1 创建索引模式3.4.2 Kibana 查看日志 总结 前言 如何查看/管理 Docker 运行容器的日志?…...
windows系统下利用python对指定文件夹下面的所有文件的创建时间进行修改
windows系统下利用python对指定文件夹下面的所有文件的创建时间进行修改 不知道其他的朋友们有没有这个需求哈,反正咱家是有这个需求 需求1、当前有大量的文件需要更改文件生成的时间,因为不可告知的原因,当前的文件创建时间是不能满足使用的…...
线性表的链式表示——单链表;头插,尾插,按值查找,按序号查找,插入,删除;
#include <iostream> #include <algorithm>//fill() #define InitSize 5using namespace std;/*线性表:链式表示——单链表;头插,尾插,按值查找,按序号查找,插入,删除*/ typedef st…...
【Spring Cloud系统】- Zookeer特性与使用场景
【Spring Cloud系统】- Zookeer特性与使用场景 一、概述 Zookeeper是一个分布式服务框架,是Apache Hadoop的一个子项目,它主要是用来解决分布式应用中经常遇到的一些数据管理问题。如:统一命名服务、状态同步服务、集群管理、分布式应用配置…...
最新AI智能创作系统源码SparkAi系统V2.6.3/AI绘画系统/支持GPT联网提问/支持Prompt应用/支持国内AI模型
一、智能AI创作系统 SparkAi创作系统是基于OpenAI很火的ChatGPT进行开发的Ai智能问答系统,已支持OpenAIGPT全模型国内AI全模型,已支持国内AI模型 百度文心一言、微软Azure、阿里云通义千问模型、清华智谱AIChatGLM、科大讯飞星火大模型等。本期针对源码…...
R | R包默认安装路径的查看及修改
R | R包默认安装路径的查看及修改 一、R包安装位置查看二、已安装R包查询三、R包安装位置修改四、R包安装位置永久修改 在【R: R package安装的几种方式】【R: R版本更新及R包迁移(详细步骤)】两篇文章中介绍过R包的常见安装方式,以及在不同R…...
将conda虚拟环境打包并集成到singularity镜像中
1. 使用yml文件打包 conda activate your_env conda env export > environment.yml编写cond.def文件 Bootstrap: dockerFrom: continuumio/miniconda3%filesenvironment.yml%post/opt/conda/bin/conda env create -f environment.yml%runscriptexec /opt/conda/envs/$(hea…...
HTML 语义化
目录 HTML 语义化HTML5 新特性HTML 语义化的好处语义化标签的使用场景最佳实践 HTML 语义化 HTML5 新特性 标准答案: 语义化标签: <header>:页头<nav>:导航<main>:主要内容<article>&#x…...
OpenLayers 可视化之热力图
注:当前使用的是 ol 5.3.0 版本,天地图使用的key请到天地图官网申请,并替换为自己的key 热力图(Heatmap)又叫热点图,是一种通过特殊高亮显示事物密度分布、变化趋势的数据可视化技术。采用颜色的深浅来显示…...
JDK 17 新特性
#JDK 17 新特性 /**************** 文本块 *****************/ python/scala中早就支持,不稀奇 String json “”" { “name”: “Java”, “version”: 17 } “”"; /**************** Switch 语句 -> 表达式 *****************/ 挺好的ÿ…...
Android Bitmap治理全解析:从加载优化到泄漏防控的全生命周期管理
引言 Bitmap(位图)是Android应用内存占用的“头号杀手”。一张1080P(1920x1080)的图片以ARGB_8888格式加载时,内存占用高达8MB(192010804字节)。据统计,超过60%的应用OOM崩溃与Bitm…...
R语言速释制剂QBD解决方案之三
本文是《Quality by Design for ANDAs: An Example for Immediate-Release Dosage Forms》第一个处方的R语言解决方案。 第一个处方研究评估原料药粒径分布、MCC/Lactose比例、崩解剂用量对制剂CQAs的影响。 第二处方研究用于理解颗粒外加硬脂酸镁和滑石粉对片剂质量和可生产…...
面向无人机海岸带生态系统监测的语义分割基准数据集
描述:海岸带生态系统的监测是维护生态平衡和可持续发展的重要任务。语义分割技术在遥感影像中的应用为海岸带生态系统的精准监测提供了有效手段。然而,目前该领域仍面临一个挑战,即缺乏公开的专门面向海岸带生态系统的语义分割基准数据集。受…...
使用Spring AI和MCP协议构建图片搜索服务
目录 使用Spring AI和MCP协议构建图片搜索服务 引言 技术栈概览 项目架构设计 架构图 服务端开发 1. 创建Spring Boot项目 2. 实现图片搜索工具 3. 配置传输模式 Stdio模式(本地调用) SSE模式(远程调用) 4. 注册工具提…...
Netty从入门到进阶(二)
二、Netty入门 1. 概述 1.1 Netty是什么 Netty is an asynchronous event-driven network application framework for rapid development of maintainable high performance protocol servers & clients. Netty是一个异步的、基于事件驱动的网络应用框架,用于…...
认识CMake并使用CMake构建自己的第一个项目
1.CMake的作用和优势 跨平台支持:CMake支持多种操作系统和编译器,使用同一份构建配置可以在不同的环境中使用 简化配置:通过CMakeLists.txt文件,用户可以定义项目结构、依赖项、编译选项等,无需手动编写复杂的构建脚本…...
热烈祝贺埃文科技正式加入可信数据空间发展联盟
2025年4月29日,在福州举办的第八届数字中国建设峰会“可信数据空间分论坛”上,可信数据空间发展联盟正式宣告成立。国家数据局党组书记、局长刘烈宏出席并致辞,强调该联盟是推进全国一体化数据市场建设的关键抓手。 郑州埃文科技有限公司&am…...
