org.springframework.context.ApplicationContextException

tip

You need to use the spring-boot-maven-plugin in the build section of your pom.xml.

tip

To create an executable jar we need to add the spring-boot-maven-plugin to our pom.xml

tip

Use 'application.sources' instead of returning a new Application in the SpringBootServletInitializer.configure function.

You have a different solution? A short tip here would help you and many other users who saw this issue last week.

  • Working with Spring and Kotlin with Gradle
    via by Unknown author,
  • Springboot embedded container exception
    via Stack Overflow by Jota Ge
    ,
    • org.springframework.context.ApplicationContextException: Unable to start embedded container; nested exception is org.springframework.context.ApplicationContextException: Unable to start EmbeddedWebApplicationContext due to missing EmbeddedServletContainerFactory bean. at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.onRefresh(EmbeddedWebApplicationContext.java:137)[spring-boot-1.4.0.RELEASE.jar!/:1.4.0.RELEASE] at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:535)[spring-context-4.3.2.RELEASE.jar!/:4.3.2.RELEASE] at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.refresh(EmbeddedWebApplicationContext.java:122)[spring-boot-1.4.0.RELEASE.jar!/:1.4.0.RELEASE] at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:759)[spring-boot-1.4.0.RELEASE.jar!/:1.4.0.RELEASE] at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:369)[spring-boot-1.4.0.RELEASE.jar!/:1.4.0.RELEASE] at org.springframework.boot.SpringApplication.run(SpringApplication.java:313)[spring-boot-1.4.0.RELEASE.jar!/:1.4.0.RELEASE] at org.springframework.boot.SpringApplication.run(SpringApplication.java:1185)[spring-boot-1.4.0.RELEASE.jar!/:1.4.0.RELEASE] at org.springframework.boot.SpringApplication.run(SpringApplication.java:1174)[spring-boot-1.4.0.RELEASE.jar!/:1.4.0.RELEASE] at hello.Application.main(Application.java:13)[classes!/:na] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)[na:1.7.0_80] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)[na:1.7.0_80] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)[na:1.7.0_80] at java.lang.reflect.Method.invoke(Method.java:606)[na:1.7.0_80] at org.springframework.boot.loader.MainMethodRunner.run(MainMethodRunner.java:48)[gs-spring-boot-0.1.0.jar:na] at org.springframework.boot.loader.Launcher.launch(Launcher.java:87)[gs-spring-boot-0.1.0.jar:na] at org.springframework.boot.loader.Launcher.launch(Launcher.java:50)[gs-spring-boot-0.1.0.jar:na] at org.springframework.boot.loader.JarLauncher.main(JarLauncher.java:58)[gs-spring-boot-0.1.0.jar:na] Caused by: org.springframework.context.ApplicationContextException: Unable to start EmbeddedWebApplicationContext due to missing EmbeddedServletContainerFactory bean. at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.getEmbeddedServletContainerFactory(EmbeddedWebApplicationContext.java:189)[spring-boot-1.4.0.RELEASE.jar!/:1.4.0.RELEASE] at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.createEmbeddedServletContainer(EmbeddedWebApplicationContext.java:162)[spring-boot-1.4.0.RELEASE.jar!/:1.4.0.RELEASE] at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.onRefresh(EmbeddedWebApplicationContext.java:134)[spring-boot-1.4.0.RELEASE.jar!/:1.4.0.RELEASE] ... 16 more

    Users with the same issue

    Unknown visitor1 times, last one,
    Matty
    1 times, last one,
    aldrinleal
    15 times, last one,
    stigkj
    2 times, last one,
    Unknown visitor1 times, last one,
    68 more bugmates