SpringBoot使用log4j2启动java.lang.StackOverflowError的原因

jar包冲突了,具体冲突是log4j-slf4j-impl-2.10.0.jar和log4j-to-slf4j-2.10.0.jar,把log4j-slf4j-impl-2.10.0.jar在pom文件里排除引用即可,使用exclusions,解决方法如下:

<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
<exclusions>
<exclusion>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-logging</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-log4j2</artifactId>
</dependency>
posted @ 2018-10-15 09:45  ergexy  阅读(6132)  评论(0编辑  收藏  举报