org.springframework.context.ApplicationContextException: Unable to start embedded container; nested exception is org.springframework.boot.context.embedded.EmbeddedServletContainerException: Unable to start embedded Tomcat

oschina.net | 2 months ago
tip
Do you find the tips below useful? Click on the to mark them and say thanks to rafael and poroszd . Or join the community to write better ones.
  1. 0
    samebug tip
    Change the connection port and ip adress. If you're trying to connect to your server from your own computer, check if you haven't already connected to the server in another instance.
  2. 0
    samebug tip
    You need to use the spring-boot-maven-plugin in the build section of your pom.xml.
  3. 0
    samebug tip
    To create an executable jar we need to add the spring-boot-maven-plugin to our pom.xml
    via spring.io
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    Error while starting spring boot application with couchbase Error creating bean with name 'tomcatEmbeddedServletContainerFactory'

    Stack Overflow | 1 year ago | user3796838
    org.springframework.context.ApplicationContextException: Unable to start embedded container; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'tomcatEmbeddedServletContainerFactory' defined in class path resource [org/springframework/boot/autoconfigure/web/EmbeddedServletContainerAutoConfiguration$EmbeddedTomcat.class]: Initialization of bean failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.boot.autoconfigure.web.ErrorMvcAutoConfiguration': Instantiation of bean failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.springframework.boot.autoconfigure.web.ErrorMvcAutoConfiguration$$EnhancerBySpringCGLIB$$6f4ff8c5]: No default constructor found; nested exception is java.lang.NoSuchMethodException: org.springframework.boot.autoconfigure.web.ErrorMvcAutoConfiguration$$EnhancerBySpringCGLIB$$6f4ff8c5.<init>()
  6. 0
    samebug tip
    The solution is to run as root using sudo or to set different port in "application.properties" file, e.g. server.port=${port:8181}
Not finding the right solution?
Take a tour to get the most out of Samebug.

Tired of useless tips?

Automated exception search integrated into your IDE

Root Cause Analysis

  1. org.apache.catalina.LifecycleException

    A child container failed during start

    at org.apache.catalina.core.ContainerBase.startInternal()
  2. Glassfish Core
    Tomcat.start
    1. org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:919)[tomcat-embed-core-8.5.4.jar:8.5.4]
    2. org.apache.catalina.core.StandardEngine.startInternal(StandardEngine.java:262)[tomcat-embed-core-8.5.4.jar:8.5.4]
    3. org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:152)[tomcat-embed-core-8.5.4.jar:8.5.4]
    4. org.apache.catalina.core.StandardService.startInternal(StandardService.java:422)[tomcat-embed-core-8.5.4.jar:8.5.4]
    5. org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:152)[tomcat-embed-core-8.5.4.jar:8.5.4]
    6. org.apache.catalina.core.StandardServer.startInternal(StandardServer.java:791)[tomcat-embed-core-8.5.4.jar:8.5.4]
    7. org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:152)[tomcat-embed-core-8.5.4.jar:8.5.4]
    8. org.apache.catalina.startup.Tomcat.start(Tomcat.java:356)[tomcat-embed-core-8.5.4.jar:8.5.4]
    8 frames
  3. Spring Boot
    EmbeddedWebApplicationContext.onRefresh
    1. org.springframework.boot.context.embedded.tomcat.TomcatEmbeddedServletContainer.initialize(TomcatEmbeddedServletContainer.java:97)[spring-boot-1.4.1.BUILD-20160913.072636-76.jar:1.4.1.BUILD-SNAPSHOT]
    2. org.springframework.boot.context.embedded.tomcat.TomcatEmbeddedServletContainer.<init>(TomcatEmbeddedServletContainer.java:83)[spring-boot-1.4.1.BUILD-20160913.072636-76.jar:1.4.1.BUILD-SNAPSHOT]
    3. org.springframework.boot.context.embedded.tomcat.TomcatEmbeddedServletContainerFactory.getTomcatEmbeddedServletContainer(TomcatEmbeddedServletContainerFactory.java:530)[spring-boot-1.4.1.BUILD-20160913.072636-76.jar:1.4.1.BUILD-SNAPSHOT]
    4. org.springframework.boot.context.embedded.tomcat.TomcatEmbeddedServletContainerFactory.getEmbeddedServletContainer(TomcatEmbeddedServletContainerFactory.java:177)[spring-boot-1.4.1.BUILD-20160913.072636-76.jar:1.4.1.BUILD-SNAPSHOT]
    5. org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.createEmbeddedServletContainer(EmbeddedWebApplicationContext.java:164)[spring-boot-1.4.1.BUILD-20160913.072636-76.jar:1.4.1.BUILD-SNAPSHOT]
    6. org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.onRefresh(EmbeddedWebApplicationContext.java:134)[spring-boot-1.4.1.BUILD-20160913.072636-76.jar:1.4.1.BUILD-SNAPSHOT]
    6 frames
  4. Spring Context
    AbstractApplicationContext.refresh
    1. org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:535)[spring-context-4.3.2.RELEASE.jar:4.3.2.RELEASE]
    1 frame
  5. Spring Boot
    SpringApplication.run
    1. org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.refresh(EmbeddedWebApplicationContext.java:122)[spring-boot-1.4.1.BUILD-20160913.072636-76.jar:1.4.1.BUILD-SNAPSHOT]
    2. org.springframework.boot.SpringApplication.refresh(SpringApplication.java:761)[spring-boot-1.4.1.BUILD-20160913.072636-76.jar:1.4.1.BUILD-SNAPSHOT]
    3. org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:371)[spring-boot-1.4.1.BUILD-20160913.072636-76.jar:1.4.1.BUILD-SNAPSHOT]
    4. org.springframework.boot.SpringApplication.run(SpringApplication.java:315)[spring-boot-1.4.1.BUILD-20160913.072636-76.jar:1.4.1.BUILD-SNAPSHOT]
    5. org.springframework.boot.SpringApplication.run(SpringApplication.java:1186)[spring-boot-1.4.1.BUILD-20160913.072636-76.jar:1.4.1.BUILD-SNAPSHOT]
    6. org.springframework.boot.SpringApplication.run(SpringApplication.java:1175)[spring-boot-1.4.1.BUILD-20160913.072636-76.jar:1.4.1.BUILD-SNAPSHOT]
    6 frames
  6. sino.test
    SampleController.main
    1. sino.test.SampleController.main(SampleController.java:23)[classes/:na]
    1 frame