我正在使用heroku来托管grails应用。我启动并运行了应用程序,只添加了一个新的控制器方法,然后重新部署。部署成功,没有错误或奇怪的警告消息,但现在应用程序失败。
以下是日志:
heroku[slugc]: Slug compilation started
heroku[api]: Deploy 02ebfa1 by x@gmail.com
heroku[api]: Release v35 created by x@gmail.com
heroku[api]: Deploy 02ebfa1 by x@gmail.com
heroku[web.1]: State changed from crashed to starting
heroku[slugc]: Slug compilation finished
heroku[web.1]: Starting process with command `java -Xmx384m -Xss512k -XX:+UseCompressedOops -jar server/webapp-runner.jar --port 49719 target/*.war`
app[web.1]: Unable to access jarfile server/webapp-runner.jar
heroku[web.1]: Process exited with status 1
heroku[web.1]: State changed from starting to crashed
据我所知,webapp-runner.jar是heroku从我的应用程序中创建的文件。它不存在或不可访问的事实表明该文件不存在或不正确。知道如何在heroku的上下文中诊断这个吗?
答案 0 :(得分:4)
我已经将Grails WAR部署到Heroku几周没有问题,但今天就遇到了这个问题。日志中的调试信息不多,但我注意到server / webapp-runner.jar看起来不对(我认为它曾经是jetty-runner.jar)。所以我在项目的根目录中添加了我自己的Procfile,正如它在下面链接的Heroku文档入门中所说的那样。
https://devcenter.heroku.com/articles/grails#optional-declare-process-types-with-procfile
这是我添加到Procfile中的内容。
web: java $JAVA_OPTS -jar server/jetty-runner.jar --port $PORT target/*.war
这似乎已经为我解决了。
答案 1 :(得分:2)
我这里的比赛有点晚了,但我可以提供更多背景资料。这是使Tomcat成为Grails的默认容器的更改的一部分:https://devcenter.heroku.com/changelog-items/277
现在,您可以通过向项目添加system.properties文件来将Jetty指定为容器。