Hibernate: SLF4J: Failed to load class的问题及解决

问题:配置好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.jarslf4j-log4j12.jarslf4j-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,则没有错误提示


猜你喜欢

转载自blog.csdn.net/py_tamir/article/details/80247222