spring boot tomcat终止 [英] spring boot tomcat termination

查看:54
本文介绍了spring boot tomcat终止的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我遇到了完全相同的问题:终止 mvn spring-boot:run 不会停止 tomcat

I have exactly the same issue like that one: Terminating mvn spring-boot:run doesn't stop tomcat

那里的答案说它只发生在 Windows 上,但实际上并非如此.我正在使用 Intellij 在 OSX 上运行 spring boot,当我停止 spring boot 应用程序时,嵌入式 tomcat 仍在运行.这是 Spring Boot 教程中的简单示例应用程序.有什么解决办法吗?

The answer there says that it only happens on Windows but it's not actually true. I'm running spring boot on OSX with Intellij and when I stop the spring boot application the embedded tomcat is still running. The is the simple sample app from spring boot tutorial. Any solutions?

推荐答案

我遇到了同样的问题,因此我不得不查看此页面上的所有解决方案和相关解决方案.没有人对我好.这就是为什么我做了一些小的研究,看起来捕获 TCP 端口的问题只是因为 Gradle 和 mvn 都不知道使用 TCP 端口进行子操作.

I have met the same issue and as result I had to review all solutions on this page and related one. No one is good for me. That is why I have made small research and it is appeared that problems with captured TCP port happen just because neither Gradle nor mvn knows nothing about child manipulation with TCP port.

所以不要杀死进程,只需使用命令:

So instead of killing process just use command:

$ gradlew –stop 

(我希望 mvn 也存在同样的情况)

(I hope the same exists for mvn)

此命令优雅地关闭由 Gradle 启动的守护进程并释放由 Tomcat 端口捕获的端口.

This command gracefully closes daemons started by Gradle and frees captured by Tomcat ports.

这篇关于spring boot tomcat终止的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆