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.cnblogs.com/felixzh/p/12554562.html

时间: 2024-10-07 20:30:43

Unable to start ServletWebServerApplicationContext due to missing ServletWebServerFactory bean的相关文章

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

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</

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()方法的启动类的上方添加注解

解决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.sprin

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

记一次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

mysql报错:Ignoring the redo log due to missing MLOG_CHECKPOINT between the checkpoint 63593957 and the end 63593472.

mysql版本:5.7.19 系统版本:centos7.3 由于公司断电,跑在vmware虚拟机上的mysql挂掉,无法重启 innodb_force_recovery=62017-11-15T12:07:25.235397+08:00 0 [Warning] 'db' entry 'sys [email protected]' ignored in --skip-name-resolve mode.2017-11-15T12:07:25.235408+08:00 0 [Warning] 'pr

记一次Springboot启动异常

启动Springboot项目报以下异常: org.springframework.context.ApplicationContextException: Unable to start web server; nested exception is org.springframework.context.ApplicationContextException: Unable to start ServletWebServerApplicationContext due to missing S

Caused by: java.lang.NoClassDefFoundError:

org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'identityService': Lookup method resolution failed; nested exception is java.lang.IllegalStateException: Failed to introspect Class [com.example.new_oa.identity.se