zoukankan      html  css  js  c++  java
  • Java异常处理003:Springboot启动报Unable to start EmbeddedWebApplicationContext due to missing EmbeddedServletContainerFactory bean异常

        Java异常处理003:Springboot启动报Unable to start EmbeddedWebApplicationContext due to missing EmbeddedServletContainerFactory bean异常

    异常日志

    org.springframework.context.ApplicationContextException: Unable to start embedded container; nested exception is org.springframework.context.ApplicationContextException: Unable to start EmbeddedWebApplicationContext due to missing EmbeddedServletContainerFactory bean.

    分析原因

    • 原因不详

    异常解决

    • 在启动类加上@EnableAutoConfiguration注解
    package com.hs.springcloud;
    
    import org.springframework.boot.SpringApplication;
    import org.springframework.boot.SpringBootConfiguration;
    import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
    
    
    @SpringBootConfiguration
    @EnableAutoConfiguration
    public class DeptProvider8001_App {
        public static void main(String[] args){
            SpringApplication.run(DeptProvider8001_App.class,args);
        }
    }

    启动成功

      .   ____          _            __ _ _
     /\ / ___'_ __ _ _(_)_ __  __ _    
    ( ( )\___ | '_ | '_| | '_ / _` |    
     \/  ___)| |_)| | | | | || (_| |  ) ) ) )
      '  |____| .__|_| |_|_| |_\__, | / / / /
     =========|_|==============|___/=/_/_/_/
     :: Spring Boot ::        (v1.5.9.RELEASE)
  • 相关阅读:
    简单的自我介绍
    学习总结(北航助教陈彦吉)
    2019春季第十二周助教总结
    2019春季第十一周助教总结
    第十一周作业
    2019春季第十周助教总结
    2019春季第九周助教总结
    第九周作业
    2019春季第八周助教总结
    第八周作业
  • 原文地址:https://www.cnblogs.com/wobuchifanqie/p/11065766.html
Copyright © 2011-2022 走看看