Maven Spring Boot返回“无法启动嵌入式Tomcat”错误

时间:2018-08-02 14:15:00

标签: maven tomcat

当我运行“ mvn spring-boot:run”时,出现以下错误:

[ERROR] org.springframework.boot.context.embedded.tomcat.TomcatStarter - Error starting Tomcat context: org.springframework.beans.factory.BeanCreationException
[WARN] org.springframework.boot.context.embedded.AnnotationConfigEmbeddedWebApplicationContext - Exception encountered during context initialization - cancelling refresh attempt
org.springframework.context.ApplicationContextException: Unable to start embedded container; nested exception is org.springframework.boot.context.embedded.EmbeddedServletContainerException: Unable to start embedded Tomcat

我不确定是什么原因...我的pom.xml文件太长了,无法在此处发布,但我想知道这是否是问题,因此我应该对排除项进行注释:

        <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-web</artifactId>
        <exclusions>
            <exclusion>
                <artifactId>spring-boot-starter-tomcat</artifactId>
                <groupId>org.springframework.boot</groupId>
            </exclusion>
        </exclusions>
    </dependency>

0 个答案:

没有答案