解决springboot启动失败问题:Unable to start embedded container;

全部报错内容如下:

org.springframework.context.ApplicationContextException: Unable to start embedded container; nested exception is java.lang.IllegalStateException: Expected method not found: java.lang.NoSuchMethodException: org.springframework.boot.context.embedded.tomcat.TomcatEmbeddedContext.addApplicationListener(org.apache.catalina.deploy.ApplicationListener)
    at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.onRefresh(EmbeddedWebApplicationContext.java:137) ~[spring-boot-1.4.1.RELEASE.jar:1.4.1.RELEASE]
    at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:535) ~[spring-context-4.3.3.RELEASE.jar:4.3.3.RELEASE]
    at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.refresh(EmbeddedWebApplicationContext.java:122) ~[spring-boot-1.4.1.RELEASE.jar:1.4.1.RELEASE]
    at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:761) [spring-boot-1.4.1.RELEASE.jar:1.4.1.RELEASE]
    at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:371) [spring-boot-1.4.1.RELEASE.jar:1.4.1.RELEASE]
    at org.springframework.boot.SpringApplication.run(SpringApplication.java:315) [spring-boot-1.4.1.RELEASE.jar:1.4.1.RELEASE]
    at org.springframework.boot.SpringApplication.run(SpringApplication.java:1186) [spring-boot-1.4.1.RELEASE.jar:1.4.1.RELEASE]
    at org.springframework.boot.SpringApplication.run(SpringApplication.java:1175) [spring-boot-1.4.1.RELEASE.jar:1.4.1.RELEASE]
    at com.springboot5.App.main(App.java:12) [classes/:na]
Caused by: java.lang.IllegalStateException: Expected method not found: java.lang.NoSuchMethodException: org.springframework.boot.context.embedded.tomcat.TomcatEmbeddedContext.addApplicationListener(org.apache.catalina.deploy.ApplicationListener)
    at org.springframework.util.ClassUtils.getMethod(ClassUtils.java:628) ~[spring-core-4.3.3.RELEASE.jar:4.3.3.RELEASE]
    at org.springframework.boot.autoconfigure.websocket.TomcatWebSocketContainerCustomizer.addListener(TomcatWebSocketContainerCustomizer.java:86) ~[spring-boot-autoconfigure-1.4.1.RELEASE.jar:1.4.1.RELEASE]
    at org.springframework.boot.autoconfigure.websocket.TomcatWebSocketContainerCustomizer.access$100(TomcatWebSocketContainerCustomizer.java:37) ~[spring-boot-autoconfigure-1.4.1.RELEASE.jar:1.4.1.RELEASE]
    at org.springframework.boot.autoconfigure.websocket.TomcatWebSocketContainerCustomizer$1.customize(TomcatWebSocketContainerCustomizer.java:51) ~[spring-boot-autoconfigure-1.4.1.RELEASE.jar:1.4.1.RELEASE]
    at org.springframework.boot.context.embedded.tomcat.TomcatEmbeddedServletContainerFactory.configureContext(TomcatEmbeddedServletContainerFactory.java:479) ~[spring-boot-1.4.1.RELEASE.jar:1.4.1.RELEASE]
    at org.springframework.boot.context.embedded.tomcat.TomcatEmbeddedServletContainerFactory.prepareContext(TomcatEmbeddedServletContainerFactory.java:221) ~[spring-boot-1.4.1.RELEASE.jar:1.4.1.RELEASE]
    at org.springframework.boot.context.embedded.tomcat.TomcatEmbeddedServletContainerFactory.getEmbeddedServletContainer(TomcatEmbeddedServletContainerFactory.java:176) ~[spring-boot-1.4.1.RELEASE.jar:1.4.1.RELEASE]
    at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.createEmbeddedServletContainer(EmbeddedWebApplicationContext.java:164) ~[spring-boot-1.4.1.RELEASE.jar:1.4.1.RELEASE]
    at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.onRefresh(EmbeddedWebApplicationContext.java:134) ~[spring-boot-1.4.1.RELEASE.jar:1.4.1.RELEASE]
    ... 8 common frames omitted

问题分析:我这个报错原因,网上查了半天,感觉应该是和jar包冲突有关,但找了半天也没找着冲突的jar包是哪个,但是jar包肯定跟tomcat有关,后来有个帖子说IDE集成tomcat会有影响,这个报错之前,我刚把Eclipse配置了RuntimeEnvironments,所以我再次把他去掉,问题解决。

解决步骤:Eclipse-Windows-perferences-RuntimeEnvironments-将tomcat去掉。

原文地址:https://www.cnblogs.com/xujie09/p/8437165.html

时间: 2024-11-06 03:37:28

解决springboot启动失败问题:Unable to start embedded container;的相关文章

Spring Boot常见问题(二)Unable to start embedded container; nested exception is java.lang.NoSuchMethodError: org.apache.tomcat.util.scan.StandardJarScanner.setJarScanFilter(Lorg/apache/tomcat/JarScanFilter;

问题描述:通过Spring Boot官方提供的方式,写出如下HelloWorld代码. @Controller @EnableAutoConfiguration public class HelloWorld { @RequestMapping("/wu") @ResponseBody String home() { return "Hello World!"; } public static void main(String[] args) throws Exce

错误:org.springframework.context.ApplicationContextException: Unable to start embedded container; nested exception is org.springframework.context.ApplicationContextException: Unable to start EmbeddedWeb

详细错误: 1 org.springframework.context.ApplicationContextException: Unable to start embedded container; nested exception is org.springframework.context.ApplicationContextException: Unable to start EmbeddedWebApplicationContext due to missing EmbeddedSer

解决Nginx启动失败

一.Nginx下载http://nginx.org/en/download.html 二.Nginx启动失败原因1.本人下载的是nginx-1.12.1(稳定版),下载完解压后,进入路径中,start nginx,发现窗口闪过.但是查找不到nginx进程. 2.进入 nginx-1.12.1\logs 路径下,打开error.log文件,发现有以下错误日志 2017/09/19 11:07:26 [emerg] 5580#3332: bind() to 0.0.0.0:80 failed (10

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

解决spring-boot启动中碰到的问题:Cannot determine embedded database driver class for database type NONE

问题 如下: 2017-07-16 08:50:57.436  INFO 13524 --- [           main] c.p.p.web.PointshopWebApplication        : Starting PointshopWebApplication on MSI with PID 13524 (D:\javaProject\com.ppdai.pointshop\pointshop-web\target\classes started by yangliweng

解决spring-boot启动中碰到的问题:Cannot determine embedded database driver class for database type NONE(转)

问题 如下: 2017-07-16 08:50:57.436  INFO 13524 --- [           main] c.p.p.web.PointshopWebApplication        : Starting PointshopWebApplication on MSI with PID 13524 (D:\javaProject\com.ppdai.pointshop\pointshop-web\target\classes started by yangliweng

&lt;已解决&gt; Eclipse启动失败

参考:http://stackoverflow.com/questions/15404964/starting-eclipse-results-in-failed-to-create-java-virtual-machine -vm C:\Java\jdk1.6.0_25\bin\javax.exe Added above line in eclipse.ini file(on the top) and worked for me. C:\Java\jdk1.6.0_25\bin This pa

springboot启动报错:Cannot determine embedded database driver class for database type NONE.

1 package cn.zb.test; 2 3 import org.springframework.boot.SpringApplication; 4 5 import org.springframework.boot.autoconfigure.EnableAutoConfiguration; 6 7 import org.springframework.boot.autoconfigure.SpringBootApplication; 8 9 import org.springfram

多学一点(十三)——解决Linux kdump服务启动失败

kdump 是 Linux Kernel 崩溃时的转储机制,简单理解就是在系统启动过程中如果 Kernel 因为某些原因崩溃了,kdump 就会负责记录日志以便排查原因.在 CentOS 6 等 Linux 发行版中,即便采用最小化安装, kdump 也会作为服务安装到系统中,此时可能因为我们对 Linux分配的内存的限制导致 kdump 服务开机启动失败,如图 1 所示: 图-1 kdump启动失败 解决 kdump 启动失败其实很简单,只要修改 grub.conf 文件,改变crashker