ApplicationContextException: Unable to start ServletWebServerApplicationContext due to missing…..

ApplicationContextException: Unable to start ServletWebServerApplicationContext due to missing ServletWebServerFactory bean.

When I started the web project of springboot, I suddenly reported an error. At first, I suspected that I had forgotten to add the web dependency, but I found that it was not;

		<dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-web</artifactId>
            <version>2.3.8.RELEASE</version>
        </dependency>

Later, after checking for a long time, I found that I made a small mistake. It turned out that I accidentally dropped the @ springbootapplication annotation. I hope you don’t make the same mistake. When starting a web project without the @ springbootapplication annotation, the spring container can’t create the class servletwebservercapplicationcontext, And springboot project also can’t get up, bug solved, thanks for watching.

Read More: