当前位置: 首页 > 知识库问答 >
问题:

Eclipse-Maven:SLF4J:Class-path包含多个SLF4J绑定

韩峰
2023-03-14

我在尝试以Maven Build运行时遇到了这个错误。有人能帮我解决约束冲突吗,谢谢。

SLF4J: Class path contains multiple SLF4J bindings.
SLF4J: Found binding in [jar:file:/Applications/Eclipse.app/Contents/Eclipse/plugins/org.eclipse.m2e.maven.runtime.slf4j.simple_1.16.0.20200610-1735/jars/slf4j-simple-1.7.5.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [file:/Applications/Eclipse.app/Contents/Eclipse/configuration/org.eclipse.osgi/5/0/.cp/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation.
SLF4J: Actual binding is of type [org.slf4j.impl.SimpleLoggerFactory]
SLF4J: Class path contains multiple SLF4J bindings.
SLF4J: Found binding in [jar:file:/Applications/Eclipse.app/Contents/Eclipse/plugins/org.eclipse.m2e.maven.runtime.slf4j.simple_1.16.0.20200610-1735/jars/slf4j-simple-1.7.5.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [file:/Applications/Eclipse.app/Contents/Eclipse/configuration/org.eclipse.osgi/5/0/.cp/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation.
SLF4J: Actual binding is of type [org.slf4j.impl.SimpleLoggerFactory]

共有3个答案

强烨
2023-03-14

这似乎是2020-09版之前的Eclipse中的一个bug。我也有这个。

查阅https://bugs.eclipse.org/bugs/show_bug.cgi?id=506676.

据我所知,目前还没有工作。使用您项目的Maven依赖项不会解决这个问题,因为它是由m2e插件和eclipse引起的,所以它超出了您项目的范围,它在IDE中。:-(

空正豪
2023-03-14

这是Eclipse中的一个已知错误。解决方法是,单独安装Maven(不使用Eclipse嵌入的Maven二进制文件)。

然后可以在:窗口下选择外部Maven二进制文件-

我在这里使用视窗,但在Linux是相同的过程。从包管理器安装maven(例如sudo apt安装maven),然后在Eclipse中激活它。

附言:在系统上安装Maven之后,命令mvn dependency:tree也会起作用。

姜弘新
2023-03-14

这不是eclipse中的错误。我们只需要从“Eclipse的Maven集成”中卸载slf4j,这是一个已经安装在eclipse上的附加软件。你可以在eclipse市场上看到这一点。

执行以下步骤:

  1. 在eclipse中,请前往帮助-

现在,在进行maven构建时,可以检查slf4j绑定错误是否消失。享受

 类似资料:
  • 每当我启动一个基于SpringBoot的应用程序(以Maven build/goal spring-boot:run的形式运行)时,我会得到臭名昭著的SLF4J警告: 这个警告令我非常恼火,因为当从Eclipse演示一个应用程序时,潜在的客户或用户看到的第一件事就是一个红色的、多余的警告。我讨厌那样!看起来太不专业了! 仔细观察警告中列出的路径,我会声称,eclipse本身已经有两个绑定(在插件o

  • 我得到以下错误。似乎有多个日志记录框架绑定到SLF4J。不知道该怎么解决。非常感谢任何帮助。

  • 我在运行java代码时遇到以下运行时异常。有人能帮我解决绑定冲突吗。

  • 我在netbeans中有一个纯Java项目,我得到的警告是: 当然,我搜索了警告,但所有的答案都与用maven或pom.xml文件删除重复绑定有关。但是我没有pom.xml文件,也没有使用Maven。 那么如何排除绑定呢?

  • 我的应用程序服务器ibm WebSphere。我在应用程序服务器日志中得到以下错误。哪里可以设置websphere? [19.09.2012 14:56:54:940 EEST]0000000a SystemErr R SLF4J:类路径包含多个SLF4J绑定。 [19.09.2012 14:56:54:940 EEST]0000000a SystemErr R SLF4J:在[wsjar:fil