gpt4 book ai didi

java - 是否可以在 heroku 上以测试模式启动 Play 框架

转载 作者:塔克拉玛干 更新时间:2023-11-02 08:23:46 25 4
gpt4 key购买 nike

我希望能够在 Heroku 上以测试模式启动我的 Play 应用程序,这可能吗?我添加了这个 Procfile:

web:    play test --http.port=$PORT $PLAY_OPTS

但是当我启动服务器时,我可以在 Hereoku 日志中看到这一点。

←[32m2012-01-15T19:11:04+00:00 heroku[web.1]:←[0m State changed from crashed to created
←[32m2012-01-15T19:11:04+00:00 heroku[web.1]:←[0m State changed from created to starting
←[32m2012-01-15T19:11:16+00:00 heroku[web.1]:←[0m Starting process with command `play test --http.port=19429 --%prod -Dprecompiled=true
`
←[32m2012-01-15T19:11:17+00:00 app[web.1]:←[0m Listening for transport dt_socket at address: 8000
←[32m2012-01-15T19:11:18+00:00 app[web.1]:←[0m 19:11:18,040 INFO ~ Starting /app
←[32m2012-01-15T19:11:18+00:00 heroku[web.1]:←[0m Error R11 (Bad bind) -> Process bound to port 8000, should be 19429 (see environment
variable PORT)
←[32m2012-01-15T19:11:18+00:00 heroku[web.1]:←[0m Stopping process with SIGKILL
←[32m2012-01-15T19:11:18+00:00 app[web.1]:←[0m 19:11:18,048 INFO ~ Module scala is available (/app/modules/scala-0.9.1)
←[32m2012-01-15T19:11:19+00:00 heroku[web.1]:←[0m State changed from starting to crashed
←[32m2012-01-15T19:11:19+00:00 heroku[web.1]:←[0m Process exited

我猜这是因为 play 默认使用 jpda.port=8000 并且 Heroku 使用默认参数时会崩溃。他们的文档根本没有评论我所看到的测试模式,所以有没有人在 Heroku 上成功开始测试模式?我想我在 procfile 中需要类似 --jpda.port=$PORT2 的东西

最佳答案

Heroku 上的应用程序只能打开一个端口($PORT 变量中提供的端口)。不幸的是,这意味着玩!测试模式无法打开远程调试所需的第二个端口。

关于java - 是否可以在 heroku 上以测试模式启动 Play 框架,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8872736/

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