我想配置的PostgreSQL爲我播放的應用程序,但我得到以下錯誤:如何設置PostgreSQL for Play 2.0?
! Internal server error, for request [GET /] ->
java.util.concurrent.TimeoutException: Futures timed out after [300000] milliseconds at
akka.dispatch.DefaultPromise.ready(Future.scala:834)
~[akka-actor.jar:2.0] at
akka.dispatch.DefaultPromise.result(Future.scala:838)
~[akka-actor.jar:2.0] at akka.dispatch.Await$.result(Future.scala:74)
~[akka-actor.jar:2.0] at
play.core.ReloadableApplication.get(ApplicationProvider.scala:108)
~[play_2.9.1.jar:2.0] at
play.core.server.Server$class.sendHandler$1(Server.scala:59)
[play_2.9.1.jar:2.0] at
play.core.server.Server$$anonfun$getHandlerFor$4.apply(Server.scala:89)
[play_2.9.1.jar:2.0] [error] application -
! @6a64i2p5o - Internal server error, for request [GET /] ->
play.api.PlayException: Not initialized [?] at
play.api.PlayException$.apply(Exceptions.scala:122)
~[play_2.9.1.jar:2.0] at
play.core.ReloadableApplication.<init>(ApplicationProvider.scala:94)
~[play_2.9.1.jar:2.0] at
play.core.server.NettyServer$$anonfun$mainDev$1.apply(NettyServer.scala:165)
~[play_2.9.1.jar:2.0] at
play.core.server.NettyServer$$anonfun$mainDev$1.apply(NettyServer.scala:164)
~[play_2.9.1.jar:2.0] at
play.utils.Threads$.withContextClassLoader(Threads.scala:17)
~[play_2.9.1.jar:2.0] at
play.core.server.NettyServer$.mainDev(NettyServer.scala:163)
~[play_2.9.1.jar:2.0]
我用下面的配置文件:
application.conf
db.default.url="postgres://play:[email protected]:9000/Play_Playground_DB"
db.default.user=play
db.default.password=play
db.default.driver=org.postgresql.Driver
項目/ Build.scala
val appDependencies = Seq(
"postgresql" % "postgresql" % "9.1-901.jdbc4"
)
我設置了Play_Playground_DB
,可以通過終端和命令psql Play_Playground_DB
訪問它。
問題的根本原因是什麼?
該URL不是PostgreSQL會識別的;據推測,這個框架正在將它們分開並挑選出需要的部分?另外,我建議您閱讀本節並更新驅動程序jar:http://jdbc.postgresql.org/download.html#current – kgrittn 2012-04-23 15:16:39
謝謝!更新到當前版本。 – 2012-04-23 17:31:52