解决spring-boot启动异常Unable to start EmbeddedWebApplicationContext due to missing EmbeddedServletContainerFactory bean

第一种:

需要在主类头加上  @EnableAutoConfiguration

第二种:

pom文件是否加了

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

如果在上述依赖加入了tomcat来启动,需要注释掉,否则无法通过mian方法启动起来。

原文地址:https://www.cnblogs.com/zyf-yxm/p/9019533.html

时间: 2024-08-30 06:08:19

解决spring-boot启动异常Unable to start EmbeddedWebApplicationContext due to missing EmbeddedServletContainerFactory bean的相关文章

SpringCloud报错:Caused by: org.springframework.context.ApplicationContextException: Unable to start EmbeddedWebApplicationContext due to missing EmbeddedServletContainerFactory bean.

今天启动用eureka的服务消费者时,一直出现问题. SpringCloud报错: Caused by: org.springframework.context.ApplicationContextException: Unable to start EmbeddedWebApplicationContext due to missing EmbeddedServletContainerFactory bean. 解决方案: 网上的解决方案大多如下: 1.在main()方法的启动类的上方添加注解

SpringBoot Unable to start EmbeddedWebApplicationContext due to missing EmbeddedServletContainerFactory bean.

SpringBoot Unable to start EmbeddedWebApplicationContext due to missing EmbeddedServletContainerFactory bean. 解决: 添加springboot-web的注解 <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-web</

springboot报错Unable to start EmbeddedWebApplicationContext due to missing EmbeddedServletContainerFactory bean

springboot项目在启动时需要把servlet容器编译进去,这时候如果你的maven依赖里面没有配置jetty或者tomcat相关依赖就会报错. 解决方法: jetty添加 <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-jetty</artifactId> <scope>provided</s

nested exception is org.springframework.context.ApplicationContextException: Unable to start ServletWebServerApplicationContext due to missing ServletWebServerFactory bean.报错解决

近期在学springboot,学的时候遇到这个错,网上查了好多,改了不行,后来发现自己的配置类没有加@SpringBootApplication注解 Exception encountered during context initialization - cancelling refresh attempt: org.springframework.context.ApplicationContextException: Unable to start web server; nested e

Unable to start ServletWebServerApplicationContext due to missing ServletWebServerFactory bean

在Spring Boot项目中,出现这个错误有两种情况: 一,在main方法所在的类忘记添加@SpringBootApplication 二,缺少依赖,添加即可 <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-web</artifactId> </dependency> 原文地址:https://www.c

解决spring boot启动报错java.lang.NoClassDefFoundError: ch/qos/logback/classic/Level

学习了:https://blog.csdn.net/yunfeng482/article/details/78106433 没想到啊:我都看见了,idea也反编不了: 没想到要重新下载啊: 原文地址:https://www.cnblogs.com/stono/p/9126417.html

记一次springboot项目,maven引发的悲剧(Unable to start EmbeddedWebApplicationContext due to missing EmbeddedServletCont)

maven下载大的项目的时候,jar包下载出错是常见的, 但是这种情况经常能看到,如java.lang.ClassNotFoundException这样的提示, 所以一直以来也觉得maven下载jar错误也没什么,直到使用了springboot 因为springboot是内嵌tomcat的,所以当这些关于Tomcat的jar包出错时,他提示的是:Unable to start EmbeddedWebApplicationContextdue to missing EmbeddedServletC

Spring Boot启动原理解析

Spring Boot启动原理解析http://www.cnblogs.com/moonandstar08/p/6550758.html 前言 前面几章我们见识了SpringBoot为我们做的自动配置,确实方便快捷,但是对于新手来说,如果不大懂SpringBoot内部启动原理,以后难免会吃亏.所以这次博主就跟你们一起一步步揭开SpringBoot的神秘面纱,让它不在神秘. 正文 我们开发任何一个Spring Boot项目,都会用到如下的启动类 从上面代码可以看出,Annotation定义(@Sp

Spring Boot启动过程(四):Spring Boot内嵌Tomcat启动

之前在Spring Boot启动过程(二)提到过createEmbeddedServletContainer创建了内嵌的Servlet容器,我用的是默认的Tomcat. private void createEmbeddedServletContainer() { EmbeddedServletContainer localContainer = this.embeddedServletContainer; ServletContext localServletContext = getServ