springboot 中报错“LoggerFactory is not a Logback LoggerContext but Logback is on the classpath...” 解决方式

Error(13) 解决LoggerFactory is not a Logback LoggerContext but Logback is on the classpath 错误日志 Caused by: 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:/E:/IT_zhengqi 阅读详情

springboot 项目启动server子模块时,报了

"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/it00013196/.m2/repository/org/slf4j/slf4j-log4j12/1.7.26/slf4j-log4j12-1.7.26.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" 的错误。

根据提示是要移除logback或slf4j-log4j12其中一个,

方法

1.在idea中,在pom.xml(这里的pom.xml文件是引入zookeeper依赖的pom文件)文件内右键打开依赖图,如下2.找到zookeeper下面的slf4j-log4j12包

3.右键,选择exclude,可在pom.xml中排除它。

代码效果如下:

4.重新启动项目问题即可解决。

SpringBoot项目报错:LoggerFactory is not a Logback LoggerContext but Logback is on the classpath 插件,在IDEA的setting中找见Plugins下载安装,重启IDEA,重启后选中你要查看的pom文件,右键,选择:Dependency Analyzer,然后所有的依赖传递都会显示出来,再搜索框搜索你需要搜索的,如我这里slf4j,搜索见之后,点击,右侧就会出现对应的封装的相关依赖,再回到pom文件中找见对应的依赖,在依赖下加入上述依赖排除标签即可。分析:项目中有些依赖底层会封装此日志依赖,所以使用了封装了此依赖的依赖,虽然没有主动加slf4j依赖,也会报日志冲突的相关错误;一,移除slf4j; 阅读详情

相关推荐

报错:Exception in thread “main“ java.lang.IllegalArgumentException...如何解决?

🏆 本文收录于《全栈Bug调优(实战版)》专栏,致力于分享我在项目实战过程中遇到的各类Bug及其原因,并提供切实有效的解决方案。无论你是初学者还是经验丰富的开发者,本文将为你指引出一条更高效的Bug修复之路,助你早日登顶,迈向财富自由的梦想🚀!同时,欢迎大家关注、收藏、订阅本专栏,更多精彩内容正在持续更新中。让我们一起进步,Up!Up!Up!    备注: 部分问题/难题源自互联网,但经过精心筛选和整理,保证每一条解决方案都经过实战验证,真实可靠。

**My Coding Family** 2702

启动错误: Exception in thread “main“ java.lang.IllegalArgumentException: LoggerFactory is not a Logback

程序启动时报错: 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.Reload4jLoggerFactory l

进击的小白 2816

[Unity_Plastic SCM小技巧] 使用 UnityYAMLMerge 工具合并场景和预制件文件

首先YAMLMerge工具其实并不局限于PlasticSCM,git也可以,它是内置在Editor内的一个更加智能的版本控制工具,只不过正常不会启用,他的目录在C:\Program Files\Unity\Editor\Data\Tools\UnityYAMLMerge.exe(Unity Editor安装目录),MAC上:/Applications/Unity/Unity.app/Content...

unityofficial的博客 1143

java.lang.IllegalArgumentException: LoggerFactory is not a Logback LoggerContext but ...

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.apache.logging.slf4j.Log4jLoggerFactory loaded fro

莫忘、初心 3万+

Skynet 框架面试题

本文整理了游戏服务端开发面试中 Skynet 框架的高频考点,涵盖底层架构、消息派发、协程调度、网络 I/O、harbor 跨机通信、内存管理、socket 处理、阻塞操作、错误处理等核心内容。全面覆盖 Skynet 框架的原理、使用和实战问题,追求深入准确,拒绝八股文。

小赖的博客 381

FOC时序及电流采样注意事项

摘要:本文介绍了无刷电机FOC(磁场定向控制)的实现方法,重点解析了电流采样时序与PWM同步的关键技术。在S32K144平台上,需使用两个独立的ADC组件实现双路电流同步采样,采样时刻必须严格对应低边MOS管开启时间并位于PWM波形中央。文章详细说明了硬件触发时序设计、采样电阻配置原则,并通过示波器实测波形验证了电流反馈电路的正确性,指出正弦电流波形应是理想输出形态。关键点包括ADC-PWM时序同步、低边MOS采样及正确的PWM映射配置。

qq_40916548的博客 2619

springboot 报错“LoggerFactory is not a Logback LoggerContext but Logback is on the classpath.” 解决方式

springboot 项目启动server子模块时,报了 "Exception in thread "main" java.lang.IllegalArgumentException: LoggerFactory is not a Logback LoggerContext but Logback is on the classpath. Either remove Logback or ...

qq_20134605的博客 1万+

中国1986-2024年30米分辨率年最大NDVI数据集:条带修复技术与植被动态监测

本文介绍了中国1986-2024年30米分辨率年最大NDVI数据集的构建,重点阐述了针对Landsat 7 SLC-off故障等问题的条带修复技术。通过应用GapFill等核心算法,该数据集有效修复了数据缺失,为长时间序列的植被动态监测、生态变迁分析和极端气候事件评估提供了高质量、连续可靠的数据基础。

weixin_29200485的博客 167

SpringBoot启动报错:LoggerFactory is not a Logback LoggerContext but Logback is on the classpath

这个问题是slf4j包冲突所产生的问题,本博调试过程借鉴了下面链接所述博客,但情况与其不尽相同,博客将通过两种方式进行包的排除。 https://juejin.im/entry/5b6927906fb9a04fb900f611 目录 一、日志信息及错误 二、编辑pom.xml文件进行包的调整 三、直接在IDEA依赖图中进行修改 一、日志信息及错误 1、完整日志 SLF4J: Class path contains multiple SLF4J bindings. SLF4J: Found binding i

qq_34412985的博客 2万+

华为路由器 VRRP主备配置

3、R3 出口路由器。

一直被模仿,从未被超越 5584

WPF毛玻璃效果别再写C#代码了!纯XAML用Border+VisualBrush+BlurEffect三步搞定

本文详细介绍了如何在WPF中通过纯XAML实现毛玻璃效果,无需编写C#代码。通过VisualBrush、BlurEffect和Clip的黄金组合,开发者可以快速创建专业级的毛玻璃面板,提升UI的现代感和视觉层次。文章还提供了性能优化技巧和实战案例,帮助开发者在各种场景中高效应用这一技术。

weixin_28630185的博客 352

LoggerFactory is not a Logback LoggerContext but Logback is on the classpath. Either remove Logback

Springboot日志报错 报错信息 SLF4J: Class path contains multiple SLF4J bindings. SLF4J: Found binding in [jar:file:/D:/repository/org/slf4j/slf4j-log4j12/1.7.25/slf4j-log4j12-1.7.25.jar!/org/slf4j/impl/Stat...

sly1311220942的博客 3465

DevExpress中使用BandGridView实现复合(多行)表头、设置多行表头背景颜色、表格边框颜色

一、实现效果 二、 实现方法 2.1、创建复合表头 ①将创建的GridControl下的GirdView1转化为BandGridView类型; ②创建需要展示的列(指定列的名称【Name】、描述【caption】、数据字段名称【FieldName】) ③绑定列实现复合表头。 注意:如果复合表头有多行,则需要设置新增Band的Row Count,然后设置【Band properties下的AutoFillDown=false】 详细操作如下: 注意:如果要隐藏表格的设计字段内容,则需.

提供C#相关开发 、云计算、运维测试、网络安全相关技术分享与服务,有意向可联系。 2893

LoggerFactory is not a Logback LoggerContext but Logback is on the classpath

2. 如果你无法移除其他日志库的依赖,可以尝试排除冲突的依赖项。具体方法取决于你使用的构建工具和依赖管理系统。例如,如果你使用Maven,可以在对应依赖项的声明中添加``标签,将冲突的依赖项排除掉。如果你同时引入了Logback和其他日志库的依赖,可以尝试将其他日志库的依赖移除,只保留Logback的依赖。这个错误是由于在你的Java代码中使用了Logback日志库,但是同时又存在与Logback竞争的其他日志库(例如slf4j-simple)导致的冲突。排除掉冲突的jar包即可。

小白菜 1万+

YOLOv12改进策略【模型轻量化】| 替换骨干网络 CVPR-2024 StarNet,超级精简高效的轻量化模块

本文记录的是基于StarNet的YOLOv12轻量化改进方法研究。StarNet设计简洁,没有复杂的设计和精细调整的超参数,仅是一个 4 阶段的分层架构。并且其中能够在低维空间计算的同时考虑极高维的特征这一特性,进而提高模型精度。本文在替换骨干网络中配置了原论文中的starnet_s1starnet_s2starnet_s3和starnet_s4七种模型,以满足不同的需求。

Limiiiing的博客 1215

android 蓝牙通讯demo

android 下蓝牙通讯demo,实现了发现蓝牙,使能蓝牙,通过蓝牙发送消息。

Tomcat启动Springboot项目,报错LoggerFactory is not a Logback LoggerContext but Logback is on the classpath.

今天用Tomcat启动springboot打的war包时,报如下错误: SLF4J: Class path contains multiple SLF4J bindings. SLF4J: Found binding in [jar:file:/home/app/tomcat80/webapps/henry/WEB-INF/lib/slf4j-simple-1.7.22.jar!/org/slf4...

qq_33996921的博客 1374

VC中sqlite的使用

在VC中对sqlite的使用,实现数据库大批数据的快速插入,读取数据库中的数据在ListCtrl中显示

springboot 日志报错 LoggerFactory is not a Logback LoggerContext but Logback is on the classpath

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 (cla...

CoreyXuu的博客 3054

VB摄像头监控

该VB模块可对摄像头捕获的画面进行录像等,可在创建的窗口进行控制

Statistics and Machine Learning Toolbox

Statistics and Machine Learning Toolbox(带书签),MATLAB统计学习工具

Springboot中日志报错LoggerFactory is not a Logback LoggerContext but Logback is on the classpath

Springboot日志框架报错

m0_48451322的博客 686

关于Spring Boot报错:LoggerFactory is not a Logback LoggerContext but Logback is on the classpath

一、问题的现象 1、使用spring-boot-starter-web重构项目时,遇到报错: SLF4J: Class path contains multiple SLF4J bindings. SLF4J: Found binding in [jar:file:/C:/Users/mou/.m2/repository/org/slf4j/slf4j-log4j12/1.7.30/slf4j-log4j12-1.7.30.jar!/org/slf4j/impl/StaticLoggerBinder.cla

weixin_42717117的博客 1万+

spring Application报错:LoggerFactory is not a Logback LoggerContext but Logback is on the classpath.

springboot application报错: LoggerFactory is not a Logback LoggerContext but Logback is on the classpath. Either remove Logback or the competing implementation (class org.slf4j.impl.Log4jLoggerFactory...

yezhirm7的博客 999

SLF4J 异常,LoggerFactory is not a Logback LoggerContext but Logback is on the classpath.

再次启动项目,成功启动。

dingxiao123的博客 790

SpringBoot项目启动报错:LoggerFactory is not a Logback LoggerContext but Logback is on the classpath. Eithe

使用SpringBoot3.0.9开发,引入依赖。

哈 1196

SpringBoot启动:LoggerFactory is not a Logback LoggerContext but Logback is on the classpath

报错信息: SLF4J: Class path contains multiple SLF4J bindings. SLF4J: Found binding in [jar:file:/C:/Users/.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:/C:/.

D的博客 1573
上一篇: java项目web.xml配置文件中的“web-app“标签标红问题的解决方案
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

当前余额3.43元 前往充值 >
需支付:10.00元
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付元
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值