堆栈跟踪: –
-----> Heroku receiving push-----> Play 2.0 - Java app detected-----> Running: sbt clean compile stage Getting net.java.dev.jna jna 3.2.3 ... :: retrIEving :: org.scala-sbt#boot-jna confs: [default] 1 artifacts copIEd,0 already retrIEved (838kB/25ms) Getting org.scala-tools.sbt sbt_2.9.1 0.11.2 ... :: retrIEving :: org.scala-sbt#boot-app confs: [default] 37 artifacts copIEd,0 already retrIEved (7324kB/78ms) Getting Scala 2.9.1 (for sbt)... :: retrIEving :: org.scala-sbt#boot-scala confs: [default] 4 artifacts copIEd,0 already retrIEved (19939kB/188ms) [info] Loading global plugins from /tmp/build_hdhsg4dgyxy/.sbt_home/.sbt/plugins [info] Updating {file:/tmp/build_hdhsg4dgyxy/.sbt_home/.sbt/plugins/}default-05c586... [info] Resolving org.scala-tools.sbt#sbt_2.9.1;0.11.2 ... [info] Resolving org.scala-tools.sbt#main_2.9.1;0.11.2 ... [info] Resolving org.scala-tools.sbt#actions_2.9.1;0.11.2 ... [info] Resolving org.scala-tools.sbt#classfile_2.9.1;0.11.2 ... [info] Resolving org.scala-tools.sbt#io_2.9.1;0.11.2 ... [info] Resolving org.scala-tools.sbt#control_2.9.1;0.11.2 ... [info] Resolving org.scala-lang#scala-library;2.9.1 ... [info] Resolving org.scala-tools.sbt#interface;0.11.2 ... [info] Resolving org.scala-tools.sbt#logging_2.9.1;0.11.2 ... [info] Resolving org.scala-tools.sbt#process_2.9.1;0.11.2 ... [info] Resolving org.scala-tools.sbt#classpath_2.9.1;0.11.2 ... [info] Resolving org.scala-tools.sbt#launcher-interface_2.9.1;0.11.2 ... [info] Resolving org.scala-lang#scala-compiler;2.9.1 ... [info] Resolving org.scala-tools.sbt#incremental-compiler_2.9.1;0.11.2 ... [info] Resolving org.scala-tools.sbt#collections_2.9.1;0.11.2 ... [info] Resolving org.scala-tools.sbt#API_2.9.1;0.11.2 ... [info] Resolving org.scala-tools.sbt#persist_2.9.1;0.11.2 ... [info] Resolving org.scala-tools.sbinary#sbinary_2.9.0;0.4.0 ... [info] Resolving org.scala-tools.sbt#compile_2.9.1;0.11.2 ... [info] Resolving org.scala-tools.sbt#ivy_2.9.1;0.11.2 ... [info] Resolving org.apache.ivy#ivy;2.2.0 ... [info] Resolving com.jcraft#Jsch;0.1.31 ... [info] Resolving commons-httpclIEnt#commons-httpclIEnt;3.1 ... [info] Resolving commons-logging#commons-logging;1.0.4 ... [info] Resolving commons-codec#commons-codec;1.2 ... [info] Resolving org.scala-tools.sbt#completion_2.9.1;0.11.2 ... [info] Resolving jline#jline;0.9.94 ... [info] Resolving org.scala-tools.sbt#run_2.9.1;0.11.2 ... [info] Resolving org.scala-tools.sbt#task-system_2.9.1;0.11.2 ... [info] Resolving org.scala-tools.sbt#tasks_2.9.1;0.11.2 ... [info] Resolving org.scala-tools.sbt#tracking_2.9.1;0.11.2 ... [info] Resolving org.scala-tools.sbt#cache_2.9.1;0.11.2 ... [info] Resolving org.scala-tools.sbt#testing_2.9.1;0.11.2 ... [info] Resolving org.scala-tools.testing#test-interface;0.5 ... [info] Resolving org.scala-tools.sbt#compiler-interface;0.11.2 ... [info] Resolving org.scala-tools.sbt#@R_427_3013@-2_8_1;0.11.2 ... [info] Resolving org.scala-tools.sbt#@R_427_3013@-2_8_0;0.11.2 ... [info] Resolving org.scala-tools.sbt#@R_427_3013@-2_9_0;0.11.2 ... [info] Done updating. [info] Compiling 1 Scala source to /tmp/build_hdhsg4dgyxy/.sbt_home/.sbt/plugins/target/scala-2.9.1/sbt-0.11.2/classes... [info] Loading project deFinition from /tmp/build_hdhsg4dgyxy/project [info] Set current project to PostDemo (in build file:/tmp/build_hdhsg4dgyxy/) [success] Total time: 0 s,completed Jun 28,2012 2:20:47 AM [info] Updating {file:/tmp/build_hdhsg4dgyxy/}PostDemo...[info] downloading http://repo.typesafe.com/typesafe/releases/postgresql/postgresql/9.1-901.jdbc4/postgresql-9.1-901.jdbc4.jar ... [info] [SUCCESSFul ] postgresql#postgresql;9.1-901.jdbc4!postgresql.jar (117ms) [info] Done updating. [info] Compiling 4 Scala sources and 4 Java sources to /tmp/build_hdhsg4dgyxy/target/scala-2.9.1/classes... [error] {file:/tmp/build_hdhsg4dgyxy/}PostDemo/compile:compile: com.typesafe.config.ConfigException$UnresolvedSubstitution: conf/application.conf: 37: Could not resolve substitution to a value: ${DATABASE_URL} [error] Total time: 10 s,2012 2:20:57 AM ! @R_403_5138@ to build app with sbt ! Heroku push rejected,@R_403_5138@ to compile Play 2.0 - java app error: @R_403_5138@ to push some refs to 'git@heroku.com.git'
我使用以下命令将DATABASE_URL设置为环境变量: –
echo "export DATABASE_URL=postgres://postgres:1234@localhost/Play">>.bash_profile . .bash_profile
我试图设置另一个URL,我发现使用命令heroku配置,我知道这是一个很长的postgres URL,但它没有工作,每次都出现相同的异常.
这是我在application.conf文件中添加的内容
%prod.db=${DATABASE_URL}
依赖
val appDependencIEs = Seq( "postgresql" % "postgresql" % "9.1-901.jdbc4")
所以现在我对我的DATABASE_URL感到困惑.为什么heroku无法用合适的值替换它. heroku在哪里寻找合适的URL?在我的application.conf文件中或在我的系统的bash配置文件中设置的环境变量中?
任何帮助将非常感激.
谢谢
编辑
日志
2012-06-28 20:38:18,500 - [INFO] - from play in main Listening for http on port 9000...2012-06-28 20:38:25,862 - [INFO] - from play in play-akka.actor.default-dispatcher-1 database [default] connected at jdbc:postgresql://localhost/Play2012-06-28 20:38:27,470 - [ERROR] - from application in New I/O server worker #1-1 ! @6aoffk4jk - Internal server error,for request [GET /login/?username=abc&&password=abc] ->play.API.db.evolutions.InvalIDDatabaseRevision: Database 'default' needs evolution! [An sql script need to be run on your database.] at play.API.db.evolutions.EvolutionsPlugin$$anonfun$onStart.apply(Evolutions.scala:424) ~[play_2.9.1.jar:2.0.1] at play.API.db.evolutions.EvolutionsPlugin$$anonfun$onStart.apply(Evolutions.scala:410) ~[play_2.9.1.jar:2.0.1] at scala.collection.linearSeqOptimized$class.foreach(linearSeqOptimized.scala:59) ~[scala-library.jar:0.11.2] at scala.collection.immutable.List.foreach(List.scala:45) ~[scala-library.jar:0.11.2] at play.API.db.evolutions.EvolutionsPlugin.onStart(Evolutions.scala:410) ~[play_2.9.1.jar:2.0.1] at play.API.Play$$anonfun$start.apply(Play.scala:60) ~[play_2.9.1.jar:2.0.1] at play.API.Play$$anonfun$start.apply(Play.scala:60) ~[play_2.9.1.jar:2.0.1] at scala.collection.linearSeqOptimized$class.foreach(linearSeqOptimized.scala:59) ~[scala-library.jar:0.11.2] at scala.collection.immutable.List.foreach(List.scala:45) ~[scala-library.jar:0.11.2] at play.API.Play$.start(Play.scala:60) ~[play_2.9.1.jar:2.0.1] at play.core.ReloadableApplication$$anonfun$get$$anonfun$apply$$anonfun.apply(ApplicationProvIDer.scala:125) ~[play_2.9.1.jar:2.0.1] at play.core.ReloadableApplication$$anonfun$get$$anonfun$apply$$anonfun.apply(ApplicationProvIDer.scala:112) ~[play_2.9.1.jar:2.0.1] at scala.Option.map(Option.scala:133) ~[scala-library.jar:0.11.2] at play.core.ReloadableApplication$$anonfun$get$$anonfun$apply.apply(ApplicationProvIDer.scala:112) ~[play_2.9.1.jar:2.0.1] at play.core.ReloadableApplication$$anonfun$get$$anonfun$apply.apply(ApplicationProvIDer.scala:110) ~[play_2.9.1.jar:2.0.1] at scala.Either$RightProjection.flatMap(Either.scala:277) ~[scala-library.jar:0.11.2] at play.core.ReloadableApplication$$anonfun$get.apply(ApplicationProvIDer.scala:110) ~[play_2.9.1.jar:2.0.1] at play.core.ReloadableApplication$$anonfun$get.apply(ApplicationProvIDer.scala:110) ~[play_2.9.1.jar:2.0.1] at akka.dispatch.Future$$anon.liftedTree1(Future.scala:195) ~[akka-actor.jar:2.0.1] at akka.dispatch.Future$$anon.run(Future.scala:194) ~[akka-actor.jar:2.0.1] at akka.dispatch.TaskInvocation.run(Abstractdispatcher.scala:83) ~[akka-actor.jar:2.0.1] at akka.Jsr166y.ForkJoinTask$AdaptedRunnableAction.exec(ForkJoinTask.java:1381) ~[akka-actor.jar:2.0.1] at akka.Jsr166y.ForkJoinTask.doExec(ForkJoinTask.java:259) ~[akka-actor.jar:2.0.1] at akka.Jsr166y.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:974) ~[akka-actor.jar:2.0.1] at akka.Jsr166y.ForkJoinPool.runWorker(ForkJoinPool.java:1478) ~[akka-actor.jar:2.0.1] at akka.Jsr166y.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:104) ~[akka-actor.jar:2.0.1]2012-06-28 20:38:30,150 - [WARN] - from play in New I/O server worker #1-1 Applying evolution script for database 'default':# !!! WARNING! This script contains DOWNS evolutions that are likely destructives# --- Rev:2,Downs - eddafc8delete from admins;delete from employees;# --- Rev:2,Ups - 822c4dainsert into admins (username,password) values ('abc','abc');insert into admins (username,'abc');insert into employees (ID,name,email) values (1,'Super Man','superman@superhero.com');insert into employees (ID,email) values (2,'Bat man','batman@superhero.com');insert into employees (ID,email) values (3,'SpIDer Man','spIDy@superhero.com');insert into employees (ID,email) values (4,'Iron Man','ironman@superhero.com');2012-06-28 20:38:30,741 - [INFO] - from play in play-akka.actor.default-dispatcher-1 database [default] connected at jdbc:postgresql://localhost/Play2012-06-28 20:38:31,519 - [INFO] - from play in play-akka.actor.default-dispatcher-1 Application started (Dev)看来你正在混合一些Play 1和Play 2约定.看起来你正在使用Play 2.在Play 2中,设置它的最简单方法是不在application.conf中使用DATABASE_URL,而只是覆盖procfile中的数据库配置:
web: target/start -Dhttp.port=$PORT -DapplyEvolutions.default=true -Ddb.default.driver=org.postgresql.Driver -Ddb.default.url=$DATABASE_URL
有关更详细的演练,请参阅我的Play 2 Tutorial.
总结以上是内存溢出为你收集整理的postgresql – Heroku – 无法通过Play Framework应用程序设置postgres数据库?全部内容,希望文章能够帮你解决postgresql – Heroku – 无法通过Play Framework应用程序设置postgres数据库?所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)