Spring Boot App Unable to start

Reason of Spring Boot App Unable to start Spring EmbeddedWebApplicationContext due to missing EmbeddedServletContainerFactory bean.

This exception come because application main class has following attributes missing



import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import org.springframework.context.annotation.ComponentScan;

public class Program {
     public static void main(String[] args) {
  , args);

The @ComponentScan annotation tells Spring to search and register recursively through the package and its children for classes marked directly or indirectly with Spring’s @Componentannotation.

The @EnableAutoConfiguration annotation switches on reasonable default behaviours based on the content of your classpath. Application depends on the embeddable version of Tomcat and SpringMVC a Tomcat server with SpringMVC is set up and configured with reasonable defaults on your behalf.