SLF4J: Failed to load class “org.slf4j.impl.StaticLoggerBinder”.
Recently, log4f was used to integrate SSM, and the added dependencies are as follows:
<!-- log -->
<dependency>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
<version>1.2.17</version>
</dependency>
However, during operation, an error is reported:
Baidu has a lot of problems, most of which are that the jar package of slf4f is not introduced, lack of dependency or scope, but these solutions have no effect on my mistakes. The website inadvertently found the compatibility problem, so it took the compatibility problems of log4j and sl4f as a breakthrough, and finally solved the problem.
Solution: if you try to import dependencies and modify the scope is invalid, it should be a compatibility problem
https://mvnrepository.com Search slf4j-log4j12
Select a log4j version. I choose version 1.7.30 here. After entering, you can see the corresponding log4j version below.
Here: log4j version 1.2.17 corresponds to slf4j version 1.7.30
Import dependencies are as follows
<!-- log -->
<dependency>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
<version>1.2.17</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-log4j12</artifactId>
<version>1.7.30</version>
</dependency>
Problem solved!
Similar Posts:
- [Solved] Jsonobject has no from object, idea has no Maven dependency, jsonobject Maven dependency package
- [Solved] SLF4J: Failed to load class “org.slf4j.impl.StaticLoggerBinder”.
- Springboot startup error start bean ‘eurekaautoserviceregistration’ NullPointerException
- [Solved] Cannot initialize Cluster. Please check your configuration for mapreduce.framework.name and the correspond server addresses
- [Solved] Cannot initialize Cluster. Please check your configuration for mapreduce.framework.name and the correspond server addresses
- Maven does not have a servlet (an error is reported after the servlet is created)
- [Solved] SparkSQL Error: org.apache.hadoop.security.HadoopKerberosName.setRuleMechanism
- [Solved] JSTL1.2 Error: org.apache.catalina.core.StandardWrapperValve.invoke…
- [How to Solve] RestController cannot be recognized in spring boot
- [Solved] IDEA springboot Startup Error: SLF4J:Failed to load class “org.slf4j.impl.StaticLoggerBinder”