我无法停止圣杯应用程序 (3.2.8)



我用"grails run-app"启动一个grails应用程序(3.2.8(。它采用默认值并从"http://localhost:8080"开始。 从IntelliJ,甚至从Windows终端,我调用"grails stop-app",我得到以下消息: |通过 JMX 找不到应用程序,正在尝试远程关闭。 |正在关闭应用程序... |错误应用程序未运行。

在application.groovy中,我添加了: grails.project.fork.run = true

没有效果。 停止服务器的正确方法是什么?当我设置 dbCreate = 'create-drop' 来清理数据库时,我特别需要它。

你的build.gradle中有这个吗?

bootRun {
jvmArgs('-Dspring.output.ansi.enabled=always')
addResources = true
}

否则你有g:include吗? 可能是这个问题:

https://github.com/grails/grails-core/issues/10411

我在 3.3.3 中最简单的应用程序中看到了这一点。我跟踪了它到Spring Boot"关闭"端点上的权限。我通过将以下内容添加到grails-app/conf/application.yml来修复它:

management:
security:
enabled: false

由于这有效,我假设"grails stop-app"本质上是这样做的:

curl -X POST localhost:8080/shutdown

我是Grails的新手,所以可能有一个更好的解决方案,不需要下降到Spring Boot级别。

最新更新