可能原因: 1.启动类缺少@SpringBootApplication 2.缺少依赖 <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-web</artifactId> </dependency>