quartz報錯:SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder". SLF4J: Defaulting to no-op
阿新 • • 發佈:2018-12-25
到quartz官網在檢視maven的配置,官網是這樣寫的:
<dependency>
<groupId>org.quartz-scheduler</groupId>
<artifactId>quartz</artifactId>
<version>2.2.1</version>
</dependency>
將上面配置複製到pom檔案中。
運行了官方給出的案例,example1
結果列印臺報這樣的錯誤資訊:
後面看了下maven中匯入到jar包: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.
maven依賴包沒有此包,查了下文件,需要匯入slf4j-log4j12包,於是在pom檔案中複製
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-log4j12</artifactId>
<version>1.6.6</version>
</dependency>
匯入了下面2個jar包
執行程式,上面的錯誤消失