spring-boot-starter-log4j2和spring-boot-starter-logging同时存在会产生冲突
发布日期:2021-06-29 13:19:12 浏览次数:2 分类:技术文章

本文共 1105 字,大约阅读时间需要 3 分钟。

错误日志:

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.StackOverflowError	at org.apache.logging.log4j.util.StackLocator.getCallerClass(StackLocator.java:112)	at org.apache.logging.log4j.util.StackLocator.getCallerClass(StackLocator.java:125)	at org.apache.logging.log4j.util.StackLocatorUtil.getCallerClass(StackLocatorUtil.java:55)	at org.apache.logging.slf4j.Log4jLoggerFactory.getContext(Log4jLoggerFactory.java:42)	at org.apache.logging.log4j.spi.AbstractLoggerAdapter.getLogger(AbstractLoggerAdapter.java:46)	at org.apache.logging.slf4j.Log4jLoggerFactory.getLogger(Log4jLoggerFactory.java:29)	at org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:358)

产生此错误的原因:logback-classic包和slf4j包冲突。 

解决方法:

找到哪个依赖引入了logback-classic,然后用依赖排除标签排除掉。

 

找到了,然后:

org.springframework.boot
spring-boot-starter-websocket
ch.qos.logback
logback-classic

转载地址:https://changemax.blog.csdn.net/article/details/98600510 如侵犯您的版权,请留言回复原文章的地址,我们会给您删除此文章,给您带来不便请您谅解!

上一篇:java.lang.IllegalStateException: UT010019: Response already commited
下一篇:org.postgresql.util.PSQLException: 栏位索引超过许可范围:3,栏位数:2。

发表评论

最新留言

哈哈,博客排版真的漂亮呢~
[***.90.31.176]2024年04月11日 21时42分00秒