This article is a mirror article of machine translation, please click here to jump to the original article.

View: 13997|Reply: 1

[Source] Class path contains multiple SLF4J bindings.

[Copy link]
Posted on 9/12/2018 2:50:46 PM | | | |


SLF4J: Class path contains multiple SLF4J bindings.
SLF4J: Found binding in [jar:file:/C:/Users/itsvse/.m2/repository/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:/C:/Users/itsvse/.m2/repository/org/apache/logging/log4j/log4j-slf4j-impl/2.10.0/log4j-slf4j-impl-2.10.0.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: See http://www.slf4j.org/codes.html#multiple_bindingsfor an explanation.
SLF4J: Actual binding is of type [ch.qos.logback.classic.util.ContextSelectorStaticBinder]
The above error is due to a conflict in the dependencies of the jar package, which is actually bound to the log in Qos, causing my logback to not work.  Since the project is built through maven, the easiest way is to adjust the order of dependencies in the pom.xml and put the actual needs before the conflicting items.  

Original pom.xml configuration:



mybatis-spring-boot-starter actually depends on org.springframework.boot, after which our exclusion of spring-boot-starter-logging is invalid.



The correct method is as follows, just adjust the order:







Previous:Spring Boot allows cross-domain configuration
Next:Control referer with the Referer Meta tag—detailed referrer-policy
Disclaimer:
All software, programming materials or articles published by Code Farmer Network are only for learning and research purposes; The above content shall not be used for commercial or illegal purposes, otherwise, users shall bear all consequences. The information on this site comes from the Internet, and copyright disputes have nothing to do with this site. You must completely delete the above content from your computer within 24 hours of downloading. If you like the program, please support genuine software, purchase registration, and get better genuine services. If there is any infringement, please contact us by email.

Mail To:help@itsvse.com