LoggerFactory is not a Logback LoggerContext but Logback is on the classpath.

启动Spring Boot项目时,报错:
LoggerFactory is not a Logback LoggerContext but Logback is on the classpath. Either remove Logback or the competing implementation (class org.slf4j.impl.LogFactoryImpl loaded from file:/Users/hao/.m2/repository/com/fireflysource/firefly-slf4j/4.9.5/firefly-slf4j-4.9.5.jar). If you are using WebLogic you will need to add ‘org.slf4j’ to prefer-application-packages in WEB-INF/weblogic.xml: org.slf4j.impl.LogFactoryImpl

IDEA插件中安装Maven Helper,点击pom.xml,会有一个Dependency Analyzer选项,在里面点击All Dependencies as List,搜索上面错误里的firefly-slf4j,然后在左侧栏里点击firefly-slf4j,右侧栏里点击最上面的节点,右键Exclude,然后刷新maven,重新启动就可以了。

又坑了我半天,如果是Java 9及以上,用module-info更容易解决,可以当前是Java 8,必须在maven这里解决。

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

风铃峰顶

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值