Unable to start embedded Tomcat servlet container: Tomcat connector in failed state
netstat -ano | findstr :8080 (Win)
lsof -i:8080 (Linux/Mac)
taskkill /PID /F
或修改 application.properties:server.port=8081。maven.compiler.source/target) 需一致。target 目錄重新建置:`mvn clean install`。@SpringBootApplication
@RestController
public class DemoApplication {
public static void main(String[] args) {
SpringApplication.run(DemoApplication.class, args);
}
@GetMapping("/")
String home() { return "Hello World!"; }
}
pom.xml 僅需 spring-boot-starter-web 與 spring-boot-maven-plugin。
application.properties 是否有錯誤配置 (如 server.address 綁定不存在 IP)。