在執行shiro項目的junit測試時,報以下錯誤,html
確實沒有找到org.slf4j.impl.StaticLoggerBinderapp
轉貼自:http://blog.csdn.net/pengxuan/article/details/6677228測試
在項目中,運行項目後出現紅色提示spa
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..net
在網上搜到一個Blog,內容大體以下:code
問題的緣由是沒法找到org.slf4j.impl.StaticLoggerBinder,我找了一下,確實沒有該類,網上搜了一下下面是官方的解答http://www.slf4j.org/codes.html#StaticLoggerBinder:orm
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.htm
You can download SLF4J bindings from the project download page.blog
大意是org.slf4j.impl.StaticLoggerBinder
沒法載入到內存,緣由是沒有找到合適的綁定SLF4J,須要添加所列舉的包中的某一個。內存
解決方法以下:
下載slf4j-nop.jar,添加到路徑中,就解決問題了