为了账号安全,请及时绑定邮箱和手机立即绑定

spring boot在idea上面创建和导入别人的demo,运行主函数报这个错

spring boot在idea上面创建和导入别人的demo,运行主函数报这个错

守着星空守着你 2019-04-26 18:15:42
Exception in thread "main" java.lang.IllegalArgumentException: LoggerFactory is not a Logback LoggerContext but Logback is on the classpath. Either remove Logback or the competing implementation (class org.slf4j.impl.Log4jLoggerFactory loaded from file:/E:/idea%e5%ad%98%e6%94%be%e5%a4%84/ssmtset2/WebContent/WEB-INF/lib/slf4j-log4j12-1.7.25.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.Log4jLoggerFactoryat org.springframework.util.Assert.instanceCheckFailed(Assert.java:637)at org.springframework.util.Assert.isInstanceOf(Assert.java:537)at org.springframework.boot.logging.logback.LogbackLoggingSystem.getLoggerContext(LogbackLoggingSystem.java:274)at org.springframework.boot.logging.logback.LogbackLoggingSystem.beforeInitialize(LogbackLoggingSystem.java:99)at org.springframework.boot.context.logging.LoggingApplicationListener.onApplicationStartingEvent(LoggingApplicationListener.java:191)at org.springframework.boot.context.logging.LoggingApplicationListener.onApplicationEvent(LoggingApplicationListener.java:170)at org.springframework.context.event.SimpleApplicationEventMulticaster.doInvokeListener(SimpleApplicationEventMulticaster.java:172)at org.springframework.context.event.SimpleApplicationEventMulticaster.invokeListener(SimpleApplicationEventMulticaster.java:165)at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:139)at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:127)at org.springframework.boot.context.event.EventPublishingRunListener.starting(EventPublishingRunListener.java:68)at org.springframework.boot.SpringApplicationRunListeners.starting(SpringApplicationRunListeners.java:48)at org.springframework.boot.SpringApplication.run(SpringApplication.java:313)
查看完整描述

2 回答

?
慕姐4208626

TA贡献1852条经验 获得超7个赞

   排除springboot对slf4j的依赖
<dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-log4j</artifactId>
            <version>1.3.8.RELEASE</version>
            <exclusions>
                <exclusion>
                    <groupId>org.slf4j</groupId>
                    <artifactId>slf4j-log4j12</artifactId>
                </exclusion>
            </exclusions>
        </dependency>


查看完整回答
反对 回复 2019-05-16
?
慕娘9325324

TA贡献1783条经验 获得超4个赞

jar包冲突把,把依赖排除掉


查看完整回答
反对 回复 2019-05-16
  • 2 回答
  • 0 关注
  • 849 浏览

添加回答

举报

0/150
提交
取消
意见反馈 帮助中心 APP下载
官方微信