Error performance:
SLF4J: Class path contains multiple SLF4J bindings.
SLF4J: Found binding in [jar:file:/D:/learn/Java/maven/repository_taotao/org/slf4j/slf4j-log4j12/1.6.4/slf4j-log4j12-1.6.4.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [jar:file:/D:/learn/Java/maven/repository_taotao/org/apache/activemq/activemq-all/5.11.2/activemq-all-5.11.2.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation.
The console error is shown in the figure below:
The cause of the error:
a jar package conflict occurred:
respectively:
SLF4J: Found binding in [jar:file:/D:/learn/Java/maven/repository_taotao/org/slf4j/slf4j-log4j12/1.6.4/slf4j-log4j12-1.6.4.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [jar:file:/D:/learn/Java/maven/repository_taotao/org/apache/activemq/activemq-all/5.11.2/activemq-all-5.11.2.jar!/org/slf4j/impl/StaticLoggerBinder.class]
solution:
You can go to pom.xml, open Dependency Hierarchy and find the slf4j entry . Except by right-clicking “exclude maven artifact” to exclude the remaining entries.
Run mvn dependency:tree and search for which dependencies have implementations of slf4j you don’t want, then use dependency exclusion to exclude them, for example:
<dependency> <groupId>org.apache.zookeeper</groupId> <artifactId>zookeeper</artifactId> <exclusions> <exclusion> <artifactId>slf4j-log4j12</artifactId> <groupId>org.slf4j</groupId> </exclusion> </exclusions> </dependency> <dependency> <groupId>com.github.sgroschupf</groupId> <artifactId>zkclient</artifactId> </dependency> <!-- Configure dependency jar packages for the ActiveMQ client --> <dependency> <groupId>org.apache.activemq</groupId> <artifactId>activemq-all</artifactId> </dependency> <dependency> <groupId>com.taotao</groupId> <artifactId>taotao-common</artifactId> <version>0.0.1-SNAPSHOT</version> <exclusions> <exclusion> <artifactId>slf4j-log4j12</artifactId> <groupId>org.slf4j</groupId> </exclusion> </exclusions> </dependency> </dependencies>
Read More:
- Log jar package conflict error: Class path contains multiple SLF4J bindings
- An error was reported when Maven package was running the packaged jar package: there is no main list attribute in xxx.jar, which can be solved by configuring Maven plugin
- log4j Error: Please initialize the log4j system properly [How to Solve]
- Log4j2 reports ERROR StatusLogger Unrecognized format specifier
- Springboot package error: failed to execute goal org.apache.maven.plugins:maven-resources-plugin: 3.2.0…
- log4j:WARN No appenders could be found for logger (freemarker.cache)
- [Solved] Junit.test use error: log4j:WARN No appenders could be found for logger
- How to Solve Maven Error: Failure to transfer com.thoughtworks.xstream:xstream:jar:1.3.1 from https://repo.maven.ap
- [Solved] Redis Error: Error creating bean with name stringRedisTemplate defined in class path resource
- Error creating bean with name ‘redistemplate’ defined in class path resource
- SpringBoot Access Clickhouse Error: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name ‘jdbcConverter’ defined in class path resource [***.class]
- Maven Error: Missing artifact jdk.tools:jdk.tools:jar:1.7
- [Solved] Found bindings for the following environments
- [Solved] ambiguous import: found package github.com/spf13/cobra/cobra in multiple modules
- [Solved] Spark Error: ERROR StatusLogger No log4j2 configuration file found
- Start error in maven web project java.lang.ClassNotFoundException: org.springframework.web.util.Log4jConfigListener
- [Solved] node Error: Could not locate the bindings file.
- Maven package error: [WARNING] The POM for xxx is missing, no dependency inform
- [Solved] Error creating bean with name ‘braveHttpServerHandler‘ defined in class path
- [Solved] Springboot Error creating bean with name ‘dataSource’ defined in class path resource