首先需要检查: 启动类是否放在所有包的父目录; 或者启动类增加注解@ComponentScan(basePackages={"com.demo.test.*"}) 其次: 在Controller中,使用@RestController注解; 或者使用@Controller注解类,并且使用@ResponseBody注解方法 最后: 检查配置文件是否有server.context-path=/hello 配置,如果有则访问地址需要ip:port/hello的方式访问。