springboot项目maven报错 LoggerFactory is not a Logback LoggerContext but Logback is on the classpath. Either remove Logback
完整信息如下
SLF4J: Class path contains multiple SLF4J bindings.
SLF4J: Found binding in [jar:file:/D:/develop/apache-maven-3.5.3/repo/org/apache/logging/log4j/log4j-slf4j-impl/2.7/log4j-slf4j-impl-2.7.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [jar:file:/D:/develop/apache-maven-3.5.3/repo/ch/qos/logback/logback-classic/1.2.3/logback-classic-1.2.3.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 [org.apache.logging.slf4j.Log4jLoggerFactory]
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.apache.logging.slf4j.Log4jLoggerFactory loaded from file:/D:/develop/apache-maven-3.5.3/repo/org/apache/logging/log4j/log4j-slf4j-impl/2.7/log4j-slf4j-impl-2.7.jar). If you are using WebLogic you will need to add 'org.slf4j' to prefer-application-packages in WEB-INF/weblogic.xml: org.apache.logging.slf4j.Log4jLoggerFactory
at org.springframework.util.Assert.instanceCheckFailed(Assert.java:389)
at org.springframework.util.Assert.isInstanceOf(Assert.java:327)
at org.springframework.boot.logging.logback.LogbackLoggingSystem.getLoggerContext(LogbackLoggingSystem.java:274)
at org.springframework.boot.logging.logback.LogbackLoggingSystem.beforeInitialize(LogbackLoggingSystem.java:98)
at org.springframework.boot.logging.LoggingApplicationListener.onApplicationStartingEvent(LoggingApplicationListener.java:230)
at org.springframework.boot.logging.LoggingApplicationListener.onApplicationEvent(LoggingApplicationListener.java:209)
at org.springframework.context.event.SimpleApplicationEventMulticaster.invokeListener(SimpleApplicationEventMulticaster.java:167)
at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:139)
at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:122)
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:303)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1162)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1151)
at test.ExampleSpringBoot.main(ExampleSpringBoot.java:108)
网上找到的解决办法:
<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>
解决办法参考2:
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-slf4j-impl</artifactId>
</dependency>
大家都在吹捧spring boot,素不知他的坑如此之多,小团队开发的过程中不太推荐使用
springboot项目maven报错 LoggerFactory is not a Logback LoggerContext but Logback is on the classpath. Either remove Logback的更多相关文章
- springboot项目启动报错Failed to configure a DataSource: 'url' attribute is not specified and no embedde
springboot项目启动报错Failed to configure a DataSource: 'url' attribute is not specified and no embedde 创建 ...
- SpringBoot项目启动报错:java.lang.RuntimeException: java.lang.reflect.InvocationTargetException
. ____ _ __ _ _ /\\ / ___'_ __ _ _(_)_ __ __ _ \ \ \ \( ( )\___ | '_ | '_| | ...
- Springboot项目启动报错,提示Cannot determine embedded database driver class for database type NONE
我在springboot项目里面引入了数据库的配置: <dependency> <groupId>org.mybatis.spring.boot</groupId> ...
- springboot项目启动报错
启动springboot项目报错: NoSuchMethodError: org.apache.tomcat.util.scan.StandardJarScanner.setJarScanFilter ...
- springboot项目启动报错 url' attribute is not specified and no embedded datasource could be configured
报错相关信息: 2019-07-22 17:12:48.971 ERROR 8312 --- [ main] o.s.b.d.LoggingFailureAnalysisReporter : **** ...
- springboot项目启动报错Communications link failure
环境情况,MySQL版本如下: 报错情况如下(看上去是和数据库有关): com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communi ...
- springboot项目连接数据库报错
学习SpringBoot也没有多久,今天SpringBoot连接数据库的时候报如下错误: java.sql.SQLException: The server time zone value '�й�� ...
- springboot项目启动报错 Failed to configure a DataSource: 'url' attribute is not specified and no embedde
参考:https://blog.csdn.net/Coyotess/article/details/80637837
- eclipse 中导入 maven项目 启动报错
导入Maven项目到Eclipse中时,出现问题如下: java.lang.ClassNotFoundException: org.springframework.web.context.Contex ...
随机推荐
- C# 简单的定时关机
using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; usin ...
- JSTL的比较运算符有哪些,用例说说它们的作用
el表达式对应的运算符 等于 == eq 不等于 != ne 大于 > gt 小于 < lt 大于等于 >= ge 小于等于 <= ...
- iframe多窗口
Window 对象 浏览器会在其打开一个 HTML 文档时创建一个对应的 window 对象.但是,如果一个文档定义了一个或多个框架(即,包含一个或多个 frame 或 iframe 标签),浏览器就 ...
- IDEA导入jar包
http://blog.csdn.net/a153375250/article/details/50851049
- ubuntu14配置opencv3.4.1(转)
网站:https://blog.csdn.net/a1429331875/article/details/31539129 写此博客的目的是为了方便大家的学习,我是搞了半天,通过上网查找资料才成功的. ...
- 2018面向对象程序设计(Java)第3周学习指导及要求
2018面向对象程序设计(Java) 第3周学习指导及要求(2018.9.11-2018.9.16) 学习目标 适应老师教学方式,能按照自主学习要求完成本周理论知识学习: 掌握Java Appli ...
- “2017面向对象程序设计(Java)第就九周学习总结”存在问题的反馈
对于“2017面向对象程序设计(Java)第就九周学习总结”存在问题的反馈 1.博文未写者:高树平 高俊梅 冯小丽 缪召召 王瑞强 宗鹏新 李向龙 马润韬 米奇辉 卯保云——不及时提交博客的同学人数出 ...
- php优化-》常用到的部分优化
1.循环内部尽可能不要声明变量: 2.在可以用PHP内部字符串操作函数的情况下,尽量不要用正则表达式: 3.foreach效率更高,尽量用foreach代替while和for循环: 4.用单引号替代双 ...
- K-means算法的实现
K-MEANS算法是一种经典的聚类算法,在模式识别得到了广泛的应用.算法中有两个关键问题需要考虑:一是如何评价对象的相似性,通常用距离来度量,距离越近越相似:另外一个是如何评价聚类的效果,通常采用误差 ...
- 用python来分割图片
程序思路: 此次程序主要是利用PIL(Python Image Libraty)这库,来进行图片的处理.PIL是一个功能非常强大的python图像处理标准库,但由于PIL只支持python2.7.如今 ...