解决方案:该应用程序不是Web应用程序,因为它在类路径上没有嵌入式容器(例如Tomcat)。加一个固定的。如果您使用的是 Maven
,则将其添加到
pom.xml:
<dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-web</artifactId></dependency>
对于 Gradle (
build.gradle),它看起来像
dependencies { compile 'org.springframework.boot:spring-boot-starter-web'}


