SLF4J: Class path contains multiple SLF4J bindings. SLF4J: Found binding in [jar:file:/D:/Maven/maven-repository/org/slf4j/slf4j-simple/1.7.12/slf4j-simple-1.7.12.jar!/org/slf4j/impl/StaticLoggerBinder.class] SLF4J: Found binding in [jar:file:/D:/Maven/maven-repository/org/slf4j/slf4j-log4j12/1.7.30/slf4j-log4j12-1.7.30.jar!/org/slf4j/impl/StaticLoggerBinder.class] SLF4J: Found binding in [jar:file:/D:/Maven/maven-repository/org/slf4j/slf4j-jdk14/1.5.6/slf4j-jdk14-1.5.6.jar!/org/slf4j/impl/StaticLoggerBinder.class] SLF4J: Found binding in [jar:file:/D:/Maven/maven-repository/org/slf4j/com.springsource.slf4j.log4j/1.6.1/com.springsource.slf4j.log4j-1.6.1.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.SimpleLoggerFactory]

时间: 2023-08-03 19:03:19 浏览: 30
这是 SLF4J(Simple Logging Facade for Java)的日志输出警告信息,它表明在你的项目中存在多个 SLF4J 的日志实现绑定。这种情况下,SLF4J 将选择其中一个作为实际的绑定。 警告信息中列出了多个绑定(bindings),并指出了这些绑定所在的 jar 包路径。例如: - slf4j-simple-1.7.12.jar - slf4j-log4j12-1.7.30.jar - slf4j-jdk14-1.5.6.jar - com.springsource.slf4j.log4j-1.6.1.jar 警告还提供了一个链接(http://www.slf4j.org/codes.html#multiple_bindings),解释了为什么会发生多个绑定的情况。 根据警告信息中的 "Actual binding is of type [org.slf4j.impl.SimpleLoggerFactory]",SLF4J 实际上选择了 `org.slf4j.impl.SimpleLoggerFactory` 作为日志实现的绑定。 如果你想解决这个警告,可以考虑以下几个步骤: 1. 检查你的项目依赖关系,确保只有需要的 SLF4J 相关的库被包含在项目中。检查你的 Maven 或 Gradle 配置文件,并删除不必要的依赖项。 2. 如果你确实需要多个 SLF4J 的日志实现,可以选择保留一个并删除其他的实现。例如,如果你想要使用 log4j2 作为日志实现,可以排除其他绑定,只保留 slf4j-log4j12 的依赖。 3. 如果你的项目中使用了其他日志框架(如 logback 或 log4j),请确保只有一个日志框架的绑定被包含在项目中。 4. 如果你的项目中没有明确指定 SLF4J 的日志实现,可以尝试在项目的依赖中添加一个合适的日志实现库,例如 logback 或 log4j。 请根据你的具体情况和项目需求进行相应调整,以解决 SLF4J 的多重绑定问题。

相关推荐

引用\[1\]、\[2\]和\[3\]中提到的错误信息都是关于SLF4J的类路径包含多个绑定的问题。这个问题通常是由于项目中引入了多个SLF4J的实现导致的。SLF4J是一个日志门面框架,它提供了统一的日志接口,而具体的日志实现可以通过不同的绑定来实现,比如log4j、logback等。当项目中引入了多个SLF4J的实现时,就会出现类路径包含多个SLF4J绑定的错误。 解决这个问题的方法是排除项目中多余的SLF4J实现。可以通过以下步骤来解决: 1. 首先,查看项目的依赖关系,确定项目中引入了哪些SLF4J的实现。可以通过查看项目的pom.xml文件或者构建工具的依赖管理工具来查看。 2. 找到多余的SLF4J实现,并将其排除。可以通过在pom.xml文件中添加排除依赖的配置来实现。例如,如果项目中引入了log4j-slf4j-impl和logback-classic两个实现,可以在pom.xml文件中排除其中一个实现,例如排除logback-classic: xml <dependency> <groupId>org.apache.logging.log4j</groupId> <artifactId>log4j-slf4j-impl</artifactId> <version>2.10.0</version> <exclusions> <exclusion> <groupId>ch.qos.logback</groupId> <artifactId>logback-classic</artifactId> </exclusion> </exclusions> </dependency> 3. 重新构建项目,确保只有一个SLF4J的实现被引入。 通过以上步骤,可以解决SLF4J类路径包含多个绑定的问题,并确保项目中只有一个SLF4J的实现被使用。\[1\]\[2\]\[3\] #### 引用[.reference_title] - *1* [SLF4J: Class path contains multiple SLF4J bindings. 问题原因及解决方法。](https://blog.csdn.net/SilenceCarrot/article/details/80609401)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^insertT0,239^v3^insert_chatgpt"}} ] [.reference_item] - *2* [Class path contains multiple SLF4J bindings.问题原因及解决方案](https://blog.csdn.net/hsuehgw/article/details/128057054)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^insertT0,239^v3^insert_chatgpt"}} ] [.reference_item] - *3* [IDEA运行报错:slf4j:Class path contains multiple SLF4J bindings. SLF4J: Found binding in [jar:file:/...](https://blog.csdn.net/qq_44425201/article/details/120863321)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^insertT0,239^v3^insert_chatgpt"}} ] [.reference_item] [ .reference_list ]

SLF4J: Class path contains multiple SLF4J bindings. SLF4J: Found binding in [jar:file:/D:/develop/maven/apache-maven-3.3.9/repo/ch/qos/logback/logback-classic/1.2.3/logback-classic-1.2.3.jar!/org/slf4j/impl/StaticLoggerBinder.class] SLF4J: Found binding in [jar:file:/D:/project/gjyw/ibms/ibms-service/lib/pierce-sdk-1.0.0-with-jdk8.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] Exception in thread "main" java.lang.IllegalArgumentException: Cannot instantiate interface org.springframework.context.ApplicationListener : org.springframework.boot.cloud.CloudFoundryVcapEnvironmentPostProcessor at org.springframework.boot.SpringApplication.createSpringFactoriesInstances(SpringApplication.java:439) at org.springframework.boot.SpringApplication.getSpringFactoriesInstances(SpringApplication.java:418) at org.springframework.boot.SpringApplication.getSpringFactoriesInstances(SpringApplication.java:409) at org.springframework.boot.SpringApplication.<init>(SpringApplication.java:261) at org.springframework.boot.SpringApplication.<init>(SpringApplication.java:240) at org.springframework.boot.SpringApplication.run(SpringApplication.java:1242) at org.springframework.boot.SpringApplication.run(SpringApplication.java:1230) at com.sdhsie.ibms.Application.main(Application.java:14) Caused by: java.lang.IllegalArgumentException: class org.springframework.boot.cloud.CloudFoundryVcapEnvironmentPostProcessor is not assignable to interface org.springframework.context.ApplicationListener at org.springframework.util.Assert.assignableCheckFailed(Assert.java:655) at org.springframework.util.Assert.isAssignable(Assert.java:586) at org.springframework.util.Assert.isAssignable(Assert.java:617) at org.springframework.boot.SpringApplication.createSpringFactoriesInstances(SpringApplication.java:432) ... 7 more 如何解决

It seems like you are encountering the issue of "multiple SLF4J bindings". This problem occurs when there are multiple implementations of the SLF4J logging facade on the classpath. SLF4J is a logging framework that serves as a simple facade for various logging frameworks such as Logback, Log4j, and java.util.logging. When you have multiple SLF4J bindings on the classpath, it can lead to conflicts and cause issues with logging initialization and output. To resolve this problem, you need to identify the conflicting SLF4J bindings and exclude the unnecessary ones from your project's dependencies. This can be done by checking your project's dependency tree or using a tool like Maven's dependency plugin. Once you have identified the conflicting dependencies, you can exclude them by adding exclusion rules in your project's build configuration file (e.g., pom.xml for Maven projects). Here's an example of how to exclude a specific SLF4J binding: xml <dependency> <groupId>your-dependency-group-id</groupId> <artifactId>your-dependency-artifact-id</artifactId> <version>your-dependency-version</version> <exclusions> <exclusion> <groupId>org.slf4j</groupId> <artifactId>slf4j-api</artifactId> </exclusion> <exclusion> <groupId>org.slf4j</groupId> <artifactId>slf4j-simple</artifactId> </exclusion> </exclusions> </dependency> By excluding the unnecessary SLF4J bindings, you can ensure that only one implementation is present in your project's classpath, resolving the "multiple SLF4J bindings" issue. Remember to adjust the exclusion rules based on your specific project dependencies and the conflicting bindings you identified.

最新推荐

胖AP华为5030dn固件

胖AP华为5030dn固件

chromedriver_win32_108.0.5359.22.zip

chromedriver可执行程序下载,请注意对应操作系统和浏览器版本号,其中文件名规则为 chromedriver_操作系统_版本号,比如 chromedriver_win32_102.0.5005.27.zip表示适合windows x86 x64系统浏览器版本号为102.0.5005.27 chromedriver_linux64_103.0.5060.53.zip表示适合linux x86_64系统浏览器版本号为103.0.5060.53 chromedriver_mac64_m1_101.0.4951.15.zip表示适合macOS m1芯片系统浏览器版本号为101.0.4951.15. chromedriver_mac64_101.0.4951.15.zip表示适合macOS x86_64系统浏览器版本号为101.0.4951.15 chromedriver_mac_arm64_108.0.5359.22.zip表示适合macOS arm64系统浏览器版本号为108.0.5359.22

HTML音乐网页界面.rar

HTML音乐网页界面

M1T-v1.6.5(带手册)---PN532 ACR122U解全加密卡.rar

M1T-v1.6.5(带手册)---PN532 ACR122U解全加密卡

海康摄像头--控件开发包web3.0.rar

海康摄像头--控件开发包web3.0

基于at89c51单片机的-智能开关设计毕业论文设计.doc

基于at89c51单片机的-智能开关设计毕业论文设计.doc

"蒙彼利埃大学与CNRS联合开发细胞内穿透载体用于靶向catphepsin D抑制剂"

由蒙彼利埃大学提供用于靶向catphepsin D抑制剂的细胞内穿透载体的开发在和CNRS研究单位- UMR 5247(马克斯·穆塞隆生物分子研究专长:分子工程由Clément Sanchez提供于2016年5月26日在评审团面前进行了辩护让·吉隆波尔多大学ARNA实验室CNRS- INSERM教授报告员塞巴斯蒂安·帕波特教授,CNRS-普瓦捷大学普瓦捷介质和材料化学研究所报告员帕斯卡尔·拉斯特洛教授,CNRS-审查员让·马丁内斯蒙彼利埃大学Max Mousseron生物分子研究所CNRS教授审查员文森特·利索夫斯基蒙彼利埃大学Max Mousseron生物分子研究所CNRS教授论文主任让-弗朗索瓦·赫尔南德斯CNRS研究总监-蒙彼利埃大学Max Mousseron生物分子研究论文共同主任由蒙彼利埃大学提供用于靶向catphepsin D抑制剂的细胞内穿透载体的开发在和CNRS研究单位- UMR 5247(马克斯·穆塞隆生物分子研究专长:分子工程由Clément Sanchez提供�

设计一个程序有一个字符串包含n个字符 写一个函数 将此字符串中从第m个字符开始的全部字符复制成为另一个字符串 用指针c语言

以下是用指针实现将字符串中从第m个字符开始的全部字符复制成为另一个字符串的C语言程序: ```c #include <stdio.h> #include <stdlib.h> #include <string.h> void copyString(char *a, char *b, int n, int m); int main() { int n, m; char *a, *b; printf("请输入字符串长度n:"); scanf("%d", &n); a = (char*)malloc(n * sizeof(char)); b =

基于C#多机联合绘图软件的实现-毕业设计论文.doc

基于C#多机联合绘图软件的实现-毕业设计论文.doc

4G车载网络中无线电资源的智能管理

4G车载网络中无线电资源的智能管理汽车网络从4G到5G的5G智能无线电资源管理巴黎萨克雷大学博士论文第580号博士学院博士专业:网络、信息与通信研究单位:巴黎萨克雷大学,UVSQ,LI PARAD,78180,法国伊夫林省圣昆廷参考:凡尔赛大学-伊夫林省圣昆廷论文于11月30日在巴黎萨克雷发表并答辩2021年,由玛丽亚姆·阿卢奇·马迪陪审团组成Pascal Lorenz总裁上阿尔萨斯大学大学教授Mohamed Yacine Ghamri-Doudane拉罗谢尔大学报告员和审查员教授Rami Langar报告员和审查员马恩河谷大学Oyunchimeg SHAGDARVEDECOM研发(HDR)团队负责人审查员论文方向Samir TOHME博士生导师巴黎萨克雷大学名誉教授UVSQ/LI- PARADKALLEL KHEMIRI共同监督巴黎萨克雷UVSQ/大卫Guy Pujolle受邀索邦大学Tara Yahiya邀请巴黎萨克雷大学/LISN高级讲师(HDR)博士论文NNT:2021UPASG061谢谢你首先,我要感谢我的论文导师M.萨米�