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

    1. <dependency>
    2. <groupId>org.springframework.boot</groupId>
    3. <artifactId>spring-boot-starter-web</artifactId>
    4. <exclusions>
    5. <exclusion>
    6. <groupId>org.springframework.boot</groupId>
    7. <artifactId>spring-boot-starter-logging</artifactId>
    8. </exclusion>
    9. </exclusions>
    10. </dependency>
    11. <dependency>
    12. <groupId>org.springframework.boot</groupId>
    13. <artifactId>spring-boot-starter-log4j2</artifactId>
    14. </dependency>