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

来源:互联网 发布:在线报名表单系统源码 编辑:程序博客网 时间:2024/05/16 09:32

在测试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.<init>(BasicTypeRegistry.java:50)
at org.hibernate.type.TypeResolver.<init>(TypeResolver.java:59)
at org.hibernate.cfg.Configuration.<init>(Configuration.java:250)
at org.hibernate.cfg.Configuration.<init>(Configuration.java:302)
at liu.qin.TestHibernate.main(TestHibernate.java:13)


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




                        

原创粉丝点击