zoukankan      html  css  js  c++  java
  • Unable to start EmbeddedWebApplicationContext due to missing EmbeddedServletContainerFactory bean

    其实是maven配置有问题,我把spring boot的内置容器干掉了,spring boot内置tomcat容器,我pom.xml是这样写的。

    <dependency>
                        <groupId>org.springframework.boot</groupId>
                        <artifactId>spring-boot-starter-web</artifactId>
                        <version>${springboot.version}</version>
                        <!--不需要打包成一个war包,或者说不用内置的spring容器,-->
                        <exclusions>
                            <exclusion>
                                <groupId>org.springframework.boot</groupId>
                                <artifactId>spring-boot-starter-tomcat</artifactId>
                            </exclusion>
                        </exclusions>
                    </dependency>
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7
    • 8
    • 9
    • 10
    • 11
    • 12

    我的pom.xml把tomcat容器干掉了,然后我又没有什么容器能够运行,所以会报错。

    我只需要使用其他容器就行,比如说下面的undertow 或者jetty

    再加个依赖就能跑了

    <!-- starter-undertow -->
                    <dependency>
                        <groupId>org.springframework.boot</groupId>
                        <artifactId>spring-boot-starter-undertow</artifactId>
                        <version>${springboot.version}</version>
                        <exclusions>
                            <exclusion>
                                <artifactId>jboss-logging</artifactId>
                                <groupId>org.jboss.logging</groupId>
                            </exclusion>
                        </exclusions>
                    </dependency>
  • 相关阅读:
    python 迭代器
    python 装饰器
    python 函数进阶
    python 函数
    python文件操作
    python 集合 深浅拷贝
    python基础之循环
    python基础之字典
    python基础之操作列表
    python基础之列表
  • 原文地址:https://www.cnblogs.com/Alex0111/p/7852907.html
Copyright © 2011-2022 走看看