After the problem occurred, I checked many things on Baidu for the first time, but none of them were dealt with. Then I thought of the following questions:
@SpringBootApplication
is not added to the startup classspring-boot-starter-web
but introduce spring-web
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
First check your pom
file carefully to see if you have added a web dependency, and delete the spring-web dependency. Generally these two problems.
Perfect solution.