SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".問題解決

SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
SLF4J: Defaulting to no-operation (NOP) logger implementation
SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.

今天在創建springboot項目運行測試時遇到以上問題,主要是說SLF4J警告或錯誤消息及其含義

 

就點擊了http://www.slf4j.org/codes.html#StaticLoggerBinder自動跳轉到SLF4J

它說是當在類路徑上找不到SLF4J提供程序時,將報告此警告(即不是錯誤)消息。將slf4j-nop.jar slf4j-simple.jarslf4j-log4j12.jar, slf4j-jdk14.jarlogback-classic.jar中的一個(僅一個)放置在類路徑上即可解決此問題。請注意,這些提供程序必須針對slf4j-api 1.8或更高版本。

問題解決:

在pom.xml配置文件中添加以下配置:

<dependencies>
  <dependency>
    <groupId> org.apache.cassandra</groupId>
    <artifactId>cassandra-all</artifactId>
    <version>0.8.1</version>

    <exclusions>
      <exclusion> 
        <groupId>org.slf4j</groupId>
        <artifactId>slf4j-log4j12</artifactId>
      </exclusion>
      <exclusion> 
        <groupId>log4j</groupId>
        <artifactId>log4j</artifactId>
      </exclusion>
    </exclusions> 

  </dependency>
</dependencies>

然後我的問題就解決了,希望對你們有幫助。

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章