springboot新建完后启动成功但是会马上给自动关闭
报错信息:
2023-01-09 10:00:12.649 INFO 14252 --- [ main] c.t.e.e.ExhookSvrJavaSpring1Application : Starting ExhookSvrJavaSpring1Application using Java 1.8.0_161 on DESKTOP-AL4FFB7 with PID 14252 (D:\work\wulian\iotcloud\acquisition\exhook-svr-java-spring1\target\classes started by thpower in D:\work\wulian\iotcloud\acquisition)
2023-01-09 10:00:12.652 INFO 14252 --- [ main] c.t.e.e.ExhookSvrJavaSpring1Application : No active profile set, falling back to 1 default profile: "default"
2023-01-09 10:00:13.073 INFO 14252 --- [ main] c.t.e.e.ExhookSvrJavaSpring1Application : Started ExhookSvrJavaSpring1Application in 0.75 seconds (JVM running for 1.497)
Disconnected from the target VM, address: '127.0.0.1:63839', transport: 'socket'
Process finished with exit code 0
解决方案:(亲测可用)
添加依赖
<dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-web</artifactId> </dependency>
参考: