快捷搜索: 王者荣耀 脱发

一直卡在 Initializing Spring embedded WebApplicationContext

描述:Spring Boot项目启动不了,一直卡在 Initializing Spring embedded WebApplicationContext,看启动日志,找到 ERROR StatusLogger Log4j2 could not find a logging implementation. Please add log4j-core to the classpath. Using SimpleLogger to log to the console… ,其实是 pom 依赖包的问题,因为项目中没有引入日志框架,却 exclusion 中排除了日志,去掉exclusion即可正常启动
    错误引入
<dependency>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-starter</artifactId>
    <scope>compile</scope>
    <exclusions>
        <exclusion>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-logging</artifactId>
        </exclusion>
    </exclusions>
</dependency>

去掉 exclusion,就可以正常启动,如下

<dependency>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-starter</artifactId>
    <scope>compile</scope>
</dependency>
经验分享 程序员 微信小程序 职场和发展