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()方法的启动类的上方添加注解 @SpringBootApplication
2.可能是pom.xml中缺少依赖包
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
这些并没有解决我的问题,检查了几个小时后,发现是我的 .class 文件名称写错了。这个错误太低级了。。
将.class名称改为与类名一致就可以了。
@SpringBootApplication
@EnableDiscoveryClient
public class EurekaConsumerApplication { public static void main(String[] args) {
new SpringApplicationBuilder(EurekaConsumerApplication.class).web(true).run(args);
}
}
SpringCloud报错:Caused by: org.springframework.context.ApplicationContextException: Unable to start EmbeddedWebApplicationContext due to missing EmbeddedServletContainerFactory bean.的更多相关文章
- Unable to start embedded container; nested exception is org.springframework.context.ApplicationContextException: Unable to start EmbeddedWebApplicationContext due to missing EmbeddedServletContainerFa
Springboot通过application启动报错 2019-01-25 14:02:33.810 ERROR [restartedMain] org.springframework.boot.S ...
- Unable to start web server; nested exception is org.springframework.context.ApplicationContextException: Unable to start ServletWebServerApplicationContext due to missing ServletWebServerFactory bean.
SpringBoot启动时的异常信息如下: "C:\Program Files\Java\jdk1.8.0_161\bin\java" ......... com.fangxing ...
- nested exception is org.springframework.context.ApplicationContextException: Unable to start ServletWebServerApplicationContext due to missing ServletWebServerFactory bean.报错解决
近期在学springboot,学的时候遇到这个错,网上查了好多,改了不行,后来发现自己的配置类没有加@SpringBootApplication注解 Exception encountered dur ...
- spring Boot 出现:org.springframework.context.ApplicationContextException: Unable to start ServletWebServerApplicationContext due to missing ServletWebServerFactory bean.
org.springframework.context.ApplicationContextException: Unable to start ServletWebServerApplication ...
- 【转载】springboot启动报错(Unable to start web server; nested exception is org.springframework.context.ApplicationContextException: Unable to start ServletWebServerApplicationContext due to missing ServletWe)
SpringBoot启动时的异常信息如下: 1 "C:\Program Files\Java\jdk1.8.0_161\bin\java" ......... com.fangxi ...
- springboot报错Unable to start EmbeddedWebApplicationContext due to missing EmbeddedServletContainerFactory bean
springboot项目在启动时需要把servlet容器编译进去,这时候如果你的maven依赖里面没有配置jetty或者tomcat相关依赖就会报错. 解决方法: jetty添加 <depend ...
- Spring boot 报错 Unable to start EmbeddedWebApplicationContext due to missing EmbeddedServletContainerFactory bean.
在实际开发中修改别人的代码,发现了这个报错,后来发现是因为pom.xml里面 只要将注释掉的部分注释掉就好了.
- 【spring boot】整合LCN,启动spring boot2.0.3 启动报错:Unable to start ServletWebServerApplicationContext due to missing ServletWebServerFactory bean.
spring boot 2.0.3启动报错: Error starting ApplicationContext. To display the conditions report re-run yo ...
- org.springframework.context.ApplicationContextException: Unable to start web server; nested exception is org.springframework.context.ApplicationContextException: Unable to start ServletWebServerApplic
org.springframework.context.ApplicationContextException: Unable to start web server; nested exceptio ...
随机推荐
- GPUImage中对比度调整的实现——GPUImageContrastFilter
对比度指的是一幅图像中明暗区域最亮的白和最暗的黑之间不同亮度层级的测量,差异范围越大代表对比越大,图像越鲜亮,差异范围越小代表对比越小,图像越灰. GPUImage中实现了对比度调整的Filter,其 ...
- ndoejs处理编码的爬虫
var express=require('express');var http=require('http');var cheerio=require('cheerio');var fs=requir ...
- python Requests库网络爬取IP地址归属地的自动查询
#IP地址查询全代码import requestsurl = "http://m.ip138.com/ip.asp?ip="try: r = requests.get(url + ...
- delphi面向对象 继承窗体
delphi继承form TFrmBase = class(TForm) procedure FormShow(Sender: TObject); end; procedure TFrmBase.Fo ...
- python 之列表推导式,集合推导式,以及字典推导式
https://www.cnblogs.com/weihengblog/p/8428124.html
- python执行外部命令并获取输出
使用subprocess库 import subprocess out_bytes = subprocess.check_output(['netstat','-a']) out_bytes = su ...
- Pronunciation – The Definitive Guide to the Top 100 Words in American English
Pronunciation – The Definitive Guide to the Top 100 Words in American English Share Tweet Share Tagg ...
- Kotlin语言学习笔记(2)
类(classes) // 类声明 class Invoice { } // 空的类 class Empty // 主体构造器(primary constructor) class Person co ...
- Android 深入浅出 - manifest文件的使用
AndroidManifest的作用简单举例 Manifest如何解析的?
- Java解决输出数组问题
package test; public class doubleshuzu { public static void main(String[] args) { double a[][]; Stri ...