[2022 New Solution] SLF4J: Failed to load class “org.slf4j.impl.StaticLoggerBinder

SLF4J: Failed to load class “org.slf4j.impl.StaticLoggerBinder

Problem introduction:

insert image description here

Problem Analysis:

According to the error message, we can know that the cause of the error is “failed to load the class file org.slf4j.impl.StaticLoggerBinder”, and the error mainly lies in the jar package of slf4j.

Official website explanation:

This error is reported when the org.slf4j.impl.StaticLoggerBinder class could not be loaded into memory. This happens when no appropriate SLF4J binding could be found on the class path. Placing one (and only one) of slf4j-nop .jar, slf4j-simple.jar, slf4j-log4j12.jar, slf4j-jdk14.jar or logback-classic.jar on the class path should solve the problem.

 

Solution:

Add a dependency configuration of one of the above package files to the pom file of the Maven project, as follows:

<dependency span>>
  <groupId>org.slf4j</groupId>
  <artifactId>slf4j-nop</artifactId>
  <version>1.7.2</version>
</dependency> 

Over!!!

Read More:

Leave a Reply

Your email address will not be published. Required fields are marked *