部署2.1.1框架到heroku

时间:2013-06-16 14:39:16

标签: heroku playframework-2.1

即时尝试将我的应用部署到heroku但我收到错误

我创建了一个proc文件并放了这行

        web: target/start --http.port=$PORT $PLAY_OPTS

我可以推送应用程序,但是当我执行此命令 heroku ps 即时收到此错误

=== web (1X): `play run --http.port=$PORT $PLAY_OPTS`
web.1: crashed 2013/06/15 22:17:41 (~ 2m ago)

并在heroku上打开即可获得应用程序错误

我做错了什么?

更新: 我编辑procfile,现在在日志中我得到这个错误
无法识别的选项: - http = 6192

2013-06-16T19:03:15.019987+00:00 heroku[slugc]: Slug compilation started
2013-06-16T19:05:18.689752+00:00 heroku[api]: Release v12 created by     miko5054@gmail.com
2013-06-16T19:05:18.658969+00:00 heroku[api]: Deploy df1da57 by miko5054@gmail.com
2013-06-16T19:05:18.741269+00:00 heroku[api]: Deploy df1da57 by miko5054@gmail.com
2013-06-16T19:05:19.331223+00:00 heroku[web.1]: State changed from crashed to starting
2013-06-16T19:05:20.703658+00:00 heroku[slugc]: Slug compilation finished
2013-06-16T19:05:27.374326+00:00 heroku[web.1]: Starting process with command    `target/start --http.port=6192 $PLAY_OPTS`
2013-06-16T19:05:28.121197+00:00 app[web.1]: Picked up JAVA_TOOL_OPTIONS:  -     Djava.rmi.server.useCodebaseOnly=true
2013-06-16T19:05:28.121197+00:00 app[web.1]: Unrecognized option: --http.port=6192
2013-06-16T19:05:28.121197+00:00 app[web.1]: Could not create the Java virtual machine.
2013-06-16T19:05:29.501307+00:00 heroku[web.1]: Process exited with status 1
2013-06-16T19:05:29.505969+00:00 heroku[web.1]: State changed from starting to crashed
2013-06-16T19:05:37.540727+00:00 heroku[web.1]: Stopping process with SIGKILL
2013-06-16T19:05:37.540529+00:00 heroku[web.1]: Error R99 (Platform error) -> Failed    to launch the dyno within 10 seconds

UPDATE2

我尝试同意 nico_etkito 建议但是 当我完全删除Procfile这就是我得到的

  2013-06-17T15:46:00.964382+00:00 heroku[web.1]: Starting process with command      `target/start -Dhttp.port=27372 -Xmx384m -Xss512k -XX:+UseCompressedOops`
  2013-06-17T15:46:03.034355+00:00 app[web.1]: Picked up JAVA_TOOL_OPTIONS:  -     Djava.rmi.server.useCodebaseOnly=true
  2013-06-17T15:46:05.654657+00:00 app[web.1]: Play server process ID is 2
  2013-06-17T15:46:08.146849+00:00 app[web.1]: [error] c.j.b.h.AbstractConnectionHook -         Failed to obtain initial connection Sleeping for 0ms and trying again. Attempts left: 0.         Exception: java.net.ConnectException: Connection refused

当这个Procfile web: target/start -Dhttp.port=${PORT}

我得到了这个结果

     2013-06-17T15:53:55.937519+00:00 heroku[web.1]: Starting process with command `target/start -Dhttp.port=${PORT}`
     2013-06-17T15:53:56.825154+00:00 app[web.1]: Picked up JAVA_TOOL_OPTIONS:  -Djava.rmi.server.useCodebaseOnly=true
      2013-06-17T15:54:02.003067+00:00 app[web.1]: Play server process ID is 2
      2013-06-17T15:54:07.088725+00:00 app[web.1]: [error] c.j.b.h.AbstractConnectionHook - Failed to obtain initial connection Sleeping for 0ms and trying again. Attempts left: 0. Exception: java.net.ConnectException: Connection refused

UPDATE3

我几乎放弃了......

但我通过使用克服了早期的问题 这个Procfile

web: target/start -Dhttp.port=${PORT} ${JAVA_OPTS} -DapplyEvolutions.default=true -  Ddb.default.driver=org.postgresql.Driver -Ddb.default.url=${DATABASE_URL}

现在我得到了这个奇怪的错误

 Caused by: org.postgresql.util.PSQLException: FATAL: role "jmcgekjnrcomcr" is not   permitted to log in

这是我在配置文件中的postgres配置

   #postgres
   db.default.driver=org.postgresql.Driver
   #db.default.url="jdbc:postgresql://localhost:5432/data"
   #db.default.user=***
    #db.default.password=***

感谢您的帮助

1 个答案:

答案 0 :(得分:1)

在最新的Heroku buildpack中,Procfile是可选的。

如果您想使用Procfile来自Play doc,则必须使用:

web: target/start -Dhttp.port=${PORT}