gpt4 book ai didi

mongodb - heroku 中的应用程序错误(使用 play 框架)

转载 作者:可可西里 更新时间:2023-11-01 09:14:34 24 4
gpt4 key购买 nike

我在 java 中使用 play-1.2.4 框架并使用 MongoDB 数据库。成功将项目推送到 heroku 存储库中。并尝试打开我的页面,我仍然看到错误:应用程序错误

An error occurred in the application and your page could not be served. Please try again in a few moments.

If you are the application owner, check your logs for details.

当我输入此 heroku logs 命令时,出现以下错误

heroku logs
2012-05-05T06:00:13+00:00 app[web.1]: ~ _ _
2012-05-05T06:00:13+00:00 app[web.1]: ~ _ __ | | __ _ _ _| |
2012-05-05T06:00:13+00:00 app[web.1]: ~ | __/|_|\____|\__ (_)
2012-05-05T06:00:13+00:00 app[web.1]: ~ | '_ \| |/ _' | || |_|
2012-05-05T06:00:13+00:00 app[web.1]: ~ |_| |__/
2012-05-05T06:00:13+00:00 app[web.1]: ~
2012-05-05T06:00:13+00:00 app[web.1]: ~ play! 1.2.4, http://www.p
layframework.org
2012-05-05T06:00:13+00:00 app[web.1]: ~ framework ID is prod
2012-05-05T06:00:13+00:00 app[web.1]: ~ Ctrl+C to stop
2012-05-05T06:00:13+00:00 app[web.1]: ~
2012-05-05T06:00:13+00:00 app[web.1]: ~
2012-05-05T06:00:13+00:00 app[web.1]:
2012-05-05T06:00:14+00:00 heroku[web.1]: Process exited with stat
us 0
2012-05-05T06:00:14+00:00 heroku[web.1]: State changed from start
ing to crashed
2012-05-05T06:05:17+00:00 heroku[run.1]: State changed from creat
ed to starting
2012-05-05T06:05:19+00:00 app[run.1]: Awaiting client
2012-05-05T06:05:20+00:00 heroku[run.1]: State changed from start
ing to up
2012-05-05T06:05:49+00:00 app[run.1]: Error R13 (Attach error) ->
Failed to attach to process
2012-05-05T06:05:50+00:00 heroku[run.1]: Process exited with stat
us 1
2012-05-05T06:05:50+00:00 heroku[run.1]: State changed from up to
complete

当我使用 heroku ps 运行 heroku 进程时,它向我显示

Process  State           Command
------- -------------- ------------------------------------
web.1 crashed for 5m play run --http.port=$PORT $PLAY_O..

当我运行 heroku run console 时,它显示以下错误:

运行连接到终端的控制台...

C:/Program Files/Heroku/l ib/heroku/client/rendezvous.rb:33:in `initialize': A connection a ttempt failed because the connected party did not properly respon d after a period of time, or established connection failed becaus e connected host has failed to respond. - connect(2) (Errno::ETIM EDOUT)
from C:/Program Files/Heroku/lib/heroku/client/rendezvous .rb:33:in `open'
from C:/Program Files/Heroku/lib/heroku/client/rendezvous .rb:33:in `block in start'
from C:/Program Files/ruby-1.9.3/lib/ruby/1.9.1/timeout.r b:58:in `timeout'
from C:/Program Files/Heroku/lib/heroku/client/rendezvous .rb:27:in `start'
from C:/Program Files/Heroku/lib/heroku/command/run.rb:35 :in `index'
from C:/Program Files/Heroku/lib/heroku/command.rb:148:in `run'
from C:/Program Files/Heroku/lib/heroku/cli.rb:9:in `star t'
from C:/Program Files/Heroku/bin/heroku:28:in `<main>'

我错过了什么?谁能帮我解决这个问题。

最佳答案

您需要在 Heroku 上以 %prod 模式运行 Play。确保您的 Procfile 中有 --%prod。这是一个示例 Procfile:

web:    play run -Xmx256M --%prod --http.port=$PORT -Dprecompiled=true

关于mongodb - heroku 中的应用程序错误(使用 play 框架),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10379614/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com