SLF4J: Failed to load class &quo

2018-12-17  本文已影响3人  CallMe兵哥

SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder"
在编程中引用slf4j时,有时候回出现“SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder” 问题,问题的原因在SLF4J的官网上能找到,slf4j-nop.jar slf4j-simple.jar, slf4j-log4j12.jar, slf4j-jdk14.jar or logback-classic.jar这几个jar包有且只有一个在的classpath路径下。

完整的maven配置为:

  <dependency>
        <groupId>log4j</groupId>
        <artifactId>log4j</artifactId>
        <version>1.2.12</version>
    </dependency>
    <dependency>
        <groupId>org.slf4j</groupId>
        <artifactId>slf4j-api</artifactId>
        <version>1.7.25</version>
    </dependency>
    <dependency>
        <groupId>org.slf4j</groupId>
        <artifactId>slf4j-log4j12</artifactId>
        <version>1.7.25</version>
    </dependency>

【官方链接】(https://www.slf4j.org/codes.html#StaticLoggerBinder

上一篇下一篇

猜你喜欢

热点阅读