运行spring boot时出现的问题:
SLF4J: Class path contains multiple SLF4J bindings.
SLF4J: Found binding in [jar:file:/D:/myworkspace/mvnworkspace/repository/ch/qos/logback/logback-classic/1.1.11/logback-classic-1.1.11.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [jar:file:/D:/myworkspace/mvnworkspace/repository/org/slf4j/slf4j-log4j12/1.7.25/slf4j-log4j12-1.7.25.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation.
SLF4J: Actual binding is of type [ch.qos.logback.classic.util.ContextSelectorStaticBinder]
但项目可以正常启动
解决方法:
首先点击右侧图中的图标


可以看到同时存在这两个包,可以顺路径找到其在哪个jar下面
在相应的jar下面加入下面语句即可,删除其中一个即可。
<exclusions>
<exclusion>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-log4j12</artifactId>
</exclusion>
</exclusions>
本文介绍了在运行Spring Boot应用时遇到SLF4J绑定冲突的问题,虽然项目能正常启动,但存在警告。解决方法是通过查看IDE的依赖结构,找出包含多个SLF4J实现的jar包,然后排除其中一个,以消除警告。
762

被折叠的 条评论
为什么被折叠?



