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>