SLF4J: The requested version 1.5.8 by your slf4j binding is not compatible with [1.6]

在测试hibernate环境是否搭建成功时,出现错误如下:

SLF4J: The requested version 1.5.8 by your slf4j binding is not compatible with [1.6]
SLF4J: See http://www.slf4j.org/codes.html#version_mismatch for further details.
Exception in thread "main" java.lang.NoSuchMethodError: org.slf4j.helpers.MessageFormatter.format(Ljava/lang/String;Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/String;
at org.slf4j.impl.Log4jLoggerAdapter.debug(Log4jLoggerAdapter.java:246)
at org.hibernate.type.BasicTypeRegistry.register(BasicTypeRegistry.java:147)
at org.hibernate.type.BasicTypeRegistry.(BasicTypeRegistry.java:50)
at org.hibernate.type.TypeResolver.(TypeResolver.java:59)
at org.hibernate.cfg.Configuration.(Configuration.java:250)
at org.hibernate.cfg.Configuration.(Configuration.java:302)
at liu.qin.TestHibernate.main(TestHibernate.java:13)


在lib中,此时slf4j的版本是1.6,而slf4j-log4j的版本是1.5.8。由于版本的不兼容性,导致了这个错误。另外下载slf4j-log4j的1.6版本后,解决问题。




                        

你可能感兴趣的:(java)