Java SLF4J:Hibernate3与RESTeasy

Java SLF4J:Hibernate3与RESTeasy,java,hibernate,slf4j,resteasy,Java,Hibernate,Slf4j,Resteasy,在我的项目中,我使用Hibernate3(依赖于slf4j-1.6)和RESTeasy(依赖于slf4j-1.5)。两者都不兼容,在运行时会出现错误 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. Exceptio

在我的项目中,我使用Hibernate3(依赖于slf4j-1.6)和RESTeasy(依赖于slf4j-1.5)。两者都不兼容,在运行时会出现错误

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.SimpleLogger.formatAndLog(SimpleLogger.java:222)
        at org.slf4j.impl.SimpleLogger.info(SimpleLogger.java:258)
        at org.hibernate.annotations.common.Version.<clinit>(Version.java:37)
SLF4J:您的SLF4J绑定请求的版本1.5.8与[1.6]不兼容
SLF4J:参见http://www.slf4j.org/codes.html#version_mismatch 详情请参阅。
线程“main”java.lang.NoSuchMethodError中出现异常:org.slf4j.helpers.MessageFormatter.format(Ljava/lang/String;Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/String;
位于org.slf4j.impl.SimpleLogger.formatAndLog(SimpleLogger.java:222)
位于org.slf4j.impl.SimpleLogger.info(SimpleLogger.java:258)
位于org.hibernate.annotations.common.Version(Version.java:37)

有什么办法可以解决这一冲突吗?

我不熟悉RESTeasy,但是我以前遇到过这个问题,我只是将所有slf4j JAR更新到了更高版本,发现我使用的依赖于旧版本的api仍然在1.6版上工作

试试看,试试也无妨


编辑:我应该说,确保将slf4j api(slf4j-api-1.x.x.jar)和插件(例如slf4j-log4j12-1.x.x.jar)更新为同一版本。

好的,现在开始。我只在类路径中使用1.5,hibernate直接使用log4j。