2013-06-02 88 views
3

我正在使用heroku來託管一個grails應用程序。我啓動並運行了應用程序,只添加了一個新的控制器方法,並重新部署。部署成功,沒有錯誤或看起來奇怪的警告消息,但現在應用程序失敗。heroku無法訪問jarfile服務器/ webapp-runner.jar

下面是日誌:

heroku[slugc]: Slug compilation started 
heroku[api]: Deploy 02ebfa1 by [email protected] 
heroku[api]: Release v35 created by [email protected] 
heroku[api]: Deploy 02ebfa1 by [email protected] 
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 

據我已經能夠確定,web應用,runner.jar是文件的Heroku創造出我的應用程序。它不存在或不可訪問的事實表明該文件不存在或不正確。任何想法如何在heroku的背景下進行診斷?

回答

4

我已經將Heroku的Grails WAR部署到Heroku幾個星期沒有問題,但今天剛剛遇到了這個問題。日誌中沒有太多調試信息,但我注意到server/webapp-runner.jar看起來不正確(我認爲它曾經是jetty-runner.jar)。因此,我在我的項目的根目錄中添加了我自己的Procfile,正如它在下面鏈接的Heroku文檔中的Grails入門所述。

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 

這似乎已經修復了我。

+0

哇!這是一個很好的結果。 – Denise

2

我對這裏的比賽有點遲,但我可以提供更多的背景知識。這是使Tomcat成爲Grails默認容器的變化的一部分:https://devcenter.heroku.com/changelog-items/277

您現在可以通過向項目添加system.properties文件來指定Jetty作爲容器。