SLF4J:Hibernate3 与 RESTeasy

发布于 2024-10-01 07:45:49 字数 702 浏览 1 评论 0原文

在我的项目中,我使用 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)

有什么想法可以解决这个冲突吗?

In my project i'm using Hibernate3 (depends on slf4j-1.6) and RESTeasy (depends on slf4j-1.5). Both are not compatible and give errors at runtime.

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)

Any ideas to solve this conflict ?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

浸婚纱 2024-10-08 07:45:49

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

尝试一下吧,尝试一下总没有坏处。

编辑:我只想说,请确保将 slf4j api (slf4j-api-1.xxjar) 和插件(例如 slf4j-log4j12-1.xxjar)更新到相同版本。

I am not familiar with RESTeasy however I have encountered this problem before, I just updated all slf4j jars to the later version and found that the api I was using that depended on the older version still worked on version 1.6.

Give it a go it can't hurt to try.

Edit: I should just say, make sure you update both the slf4j api (slf4j-api-1.x.x.jar) and the plugin (e.g. slf4j-log4j12-1.x.x.jar) to the same version.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文