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 Codeshttp://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…...
设计模式和设计原则回顾
设计模式和设计原则回顾 23种设计模式是设计原则的完美体现,设计原则设计原则是设计模式的理论基石, 设计模式 在经典的设计模式分类中(如《设计模式:可复用面向对象软件的基础》一书中),总共有23种设计模式,分为三大类: 一、创建型模式(5种) 1. 单例模式(Sing…...

YSYX学习记录(八)
C语言,练习0: 先创建一个文件夹,我用的是物理机: 安装build-essential 练习1: 我注释掉了 #include <stdio.h> 出现下面错误 在你的文本编辑器中打开ex1文件,随机修改或删除一部分,之后…...
GitHub 趋势日报 (2025年06月08日)
📊 由 TrendForge 系统生成 | 🌐 https://trendforge.devlive.org/ 🌐 本日报中的项目描述已自动翻译为中文 📈 今日获星趋势图 今日获星趋势图 884 cognee 566 dify 414 HumanSystemOptimization 414 omni-tools 321 note-gen …...
今日科技热点速览
🔥 今日科技热点速览 🎮 任天堂Switch 2 正式发售 任天堂新一代游戏主机 Switch 2 今日正式上线发售,主打更强图形性能与沉浸式体验,支持多模态交互,受到全球玩家热捧 。 🤖 人工智能持续突破 DeepSeek-R1&…...
MySQL用户和授权
开放MySQL白名单 可以通过iptables-save命令确认对应客户端ip是否可以访问MySQL服务: test: # iptables-save | grep 3306 -A mp_srv_whitelist -s 172.16.14.102/32 -p tcp -m tcp --dport 3306 -j ACCEPT -A mp_srv_whitelist -s 172.16.4.16/32 -p tcp -m tcp -…...

分布式增量爬虫实现方案
之前我们在讨论的是分布式爬虫如何实现增量爬取。增量爬虫的目标是只爬取新产生或发生变化的页面,避免重复抓取,以节省资源和时间。 在分布式环境下,增量爬虫的实现需要考虑多个爬虫节点之间的协调和去重。 另一种思路:将增量判…...
掌握 HTTP 请求:理解 cURL GET 语法
cURL 是一个强大的命令行工具,用于发送 HTTP 请求和与 Web 服务器交互。在 Web 开发和测试中,cURL 经常用于发送 GET 请求来获取服务器资源。本文将详细介绍 cURL GET 请求的语法和使用方法。 一、cURL 基本概念 cURL 是 "Client URL" 的缩写…...

什么是VR全景技术
VR全景技术,全称为虚拟现实全景技术,是通过计算机图像模拟生成三维空间中的虚拟世界,使用户能够在该虚拟世界中进行全方位、无死角的观察和交互的技术。VR全景技术模拟人在真实空间中的视觉体验,结合图文、3D、音视频等多媒体元素…...

软件工程 期末复习
瀑布模型:计划 螺旋模型:风险低 原型模型: 用户反馈 喷泉模型:代码复用 高内聚 低耦合:模块内部功能紧密 模块之间依赖程度小 高内聚:指的是一个模块内部的功能应该紧密相关。换句话说,一个模块应当只实现单一的功能…...

uni-app学习笔记三十五--扩展组件的安装和使用
由于内置组件不能满足日常开发需要,uniapp官方也提供了众多的扩展组件供我们使用。由于不是内置组件,需要安装才能使用。 一、安装扩展插件 安装方法: 1.访问uniapp官方文档组件部分:组件使用的入门教程 | uni-app官网 点击左侧…...