今天启动用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.的更多相关文章

  1. 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 ...

  2. 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 ...

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

    近期在学springboot,学的时候遇到这个错,网上查了好多,改了不行,后来发现自己的配置类没有加@SpringBootApplication注解 Exception encountered dur ...

  4. spring Boot 出现:org.springframework.context.ApplicationContextException: Unable to start ServletWebServerApplicationContext due to missing ServletWebServerFactory bean.

    org.springframework.context.ApplicationContextException: Unable to start ServletWebServerApplication ...

  5. 【转载】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 ...

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

    springboot项目在启动时需要把servlet容器编译进去,这时候如果你的maven依赖里面没有配置jetty或者tomcat相关依赖就会报错. 解决方法: jetty添加 <depend ...

  7. Spring boot 报错 Unable to start EmbeddedWebApplicationContext due to missing EmbeddedServletContainerFactory bean.

    在实际开发中修改别人的代码,发现了这个报错,后来发现是因为pom.xml里面 只要将注释掉的部分注释掉就好了.

  8. 【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 ...

  9. 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 ...

随机推荐

  1. GPUImage中对比度调整的实现——GPUImageContrastFilter

    对比度指的是一幅图像中明暗区域最亮的白和最暗的黑之间不同亮度层级的测量,差异范围越大代表对比越大,图像越鲜亮,差异范围越小代表对比越小,图像越灰. GPUImage中实现了对比度调整的Filter,其 ...

  2. ndoejs处理编码的爬虫

    var express=require('express');var http=require('http');var cheerio=require('cheerio');var fs=requir ...

  3. python Requests库网络爬取IP地址归属地的自动查询

    #IP地址查询全代码import requestsurl = "http://m.ip138.com/ip.asp?ip="try: r = requests.get(url + ...

  4. delphi面向对象 继承窗体

    delphi继承form TFrmBase = class(TForm) procedure FormShow(Sender: TObject); end; procedure TFrmBase.Fo ...

  5. python 之列表推导式,集合推导式,以及字典推导式

    https://www.cnblogs.com/weihengblog/p/8428124.html

  6. python执行外部命令并获取输出

    使用subprocess库 import subprocess out_bytes = subprocess.check_output(['netstat','-a']) out_bytes = su ...

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

  8. Kotlin语言学习笔记(2)

    类(classes) // 类声明 class Invoice { } // 空的类 class Empty // 主体构造器(primary constructor) class Person co ...

  9. Android 深入浅出 - manifest文件的使用

    AndroidManifest的作用简单举例 Manifest如何解析的?

  10. Java解决输出数组问题

    package test; public class doubleshuzu { public static void main(String[] args) { double a[][]; Stri ...