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>
  • 相关阅读:
    postgresql 配置文件优化
    postgresql 主从配置
    关于 pgsql 数据库json几个函数用法的效率测试
    linux 常用命令大全
    linux 禁ping本机方法
    inotify 心得
    安装PHP扩展
    centos 防火墙配置
    Java好的的工具类:JsonUtils
    Java好的的工具类:JSONResult
  • 原文地址:https://www.cnblogs.com/Alex0111/p/7852907.html
Copyright © 2011-2022 走看看