问题:配置好Hibernate基本环境后,console 出现以下信息:
SLF4J: Failed to load class “org.slf4j.impl.StaticLoggerBinder”.
SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.
Exception in thread “main” java.lang.NoClassDefFoundError: org/slf4j/impl/StaticLoggerBinder
……
解决:
官方提示为:
No SLF4J providers were found.
This warning, i.e. not an error, message is reported when no SLF4J providers 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
解决方案:
下载上述某个jar,即可。
本人下载的为slf4j-nop/1.6.4.jar,下载网站为 http://mvnrepository.com/artifact/org.slf4j/slf4j-nop/1.6.4
将下载后的jar放在工程lib引用中,run project,则没有错误提示
本文解决配置Hibernate环境后出现的SLF4J警告问题。通过下载并配置slf4j-nop.jar等文件之一到项目的类路径中,可以消除此警告。
1847

被折叠的 条评论
为什么被折叠?



