Description of the problem: Tomcat is stuck at startup, and the error log is as follows:
November 07, 2017 8:35:45 PM org.apache.catalina.core.ApplicationContext log Information: Initializing Spring root WebApplicationContext SLF4J: Class path contains multiple SLF4J bindings. SLF4J: Found binding in [jar:file: /E:/workspace/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/wtpwebapps/wlf-notify/WEB-INF/lib/log4j-slf4j- impl-2.9.1.jar!/org/slf4j/impl/StaticLoggerBinder. class ] SLF4J: Found binding in [jar:file: /E:/workspace/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/wtpwebapps/wlf-notify/WEB-INF/lib/slf4j-log4j12- 1.7.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 [org.apache.logging.slf4j.Log4jLoggerFactory]
Problem location: From the log, I see that the two log jar packages conflict: log4j-slf4j-impl-2.9.1.jar and slf4j-log4j12-1.7.2.jar
Solve the problem:
1. Simple solution: According to the local tomcat path given in the log, enter the lib, delete one of them, and enter E:/workspace/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/wtpwebapps/ wlf-notify/WEB-INF/lib, delete log4j-slf4j-impl-2.9.1.jar, and restart.
2. The fundamental solution: through maven’s dependency tree analysis, and then through execluse to eliminate conflicting dependencies in pom.xml.
Read More:
- [Solved] Maven log jar package conflict error: Class path contains multiple SLF4J bindings
- log4j Error: Please initialize the log4j system properly [How to Solve]
- 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
- Log4j2 reports ERROR StatusLogger Unrecognized format specifier
- 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
- [Solved] Found bindings for the following environments
- [Solved] Spark Error: ERROR StatusLogger No log4j2 configuration file found
- [Solved] node Error: Could not locate the bindings file.
- Error creating bean with name ‘redistemplate’ defined in class path resource
- [Solved] Arm Server kibana7.4.1 Error: Sending Logstash logs to /home/logstash-6.8.4/logs which is now configured via log4j2.properties
- [Solved] ambiguous import: found package github.com/spf13/cobra/cobra in multiple modules
- [Solved] Error creating bean with name ‘enableRedisKeyspaceNotificationsInitializer‘ defined in class path
- [Solved] ERROR–Unable to process Jar entry [module-info.class] from Jar
- [Solved] Error creating bean with name ‘braveHttpServerHandler‘ defined in class path
- [Solved] Error creating bean with name ‘sqlSessionFactory‘ defined in class path resource
- [Solved] Redis Error: Error creating bean with name stringRedisTemplate 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]
- [Solved] Error creating bean with name ‘enableRedisKeyspaceNotificationsInitializer‘ defined in class path re
- Nexus3 builds Jenkins error: Not authorized (Downloading dependent jar package error)