Kno*_*uch 11 scala playframework
我有一个有效的播放框架应用程序。我试图在应用程序上启用数据库进化支持。我通过添加以下设置更改了 application.conf 文件
db.default.driver=org.postgresql.Driver
db.default.url="jdbc:postgresql://localhost:5432/scaladb"
db.default.username=scalauser
db.default.password=******
db.default.poolInitialSize=1
db.default.poolMaxSize=5
db.default.ConnectionTimeoutMillis=1000
play.evolutions.autoApply=true
Run Code Online (Sandbox Code Playgroud)
数据库存在,我可以使用类似的命令连接到它 sql -U scalauser -d scaladb
我将以下行添加到我的 AppLoader 类中以设置数据库并运行迁移
val onStart = {
applicationEvolutions
DBs.setupAll()
}
applicationLifecycle.addStopHook{() =>
DBs.closeAll()
Future.successful(Unit)
}
Run Code Online (Sandbox Code Playgroud)
但是现在当我运行我的应用程序时,set run我收到了这个神秘的错误消息,实际上没有任何意义。我什至不确定这是框架试图告诉我的
akka.http.impl.util.One2OneBidiFlow$OutputTruncationException: Inner flow was completed without producing result elements for 1 outstanding elements
at akka.http.impl.util.One2OneBidiFlow$OutputTruncationException$.apply(One2OneBidiFlow.scala:22)
at akka.http.impl.util.One2OneBidiFlow$OutputTruncationException$.apply(One2OneBidiFlow.scala:22)
at akka.http.impl.util.One2OneBidiFlow$One2OneBidi$$anon$1$$anon$4.onUpstreamFinish(One2OneBidiFlow.scala:97)
at akka.stream.impl.fusing.GraphInterpreter.processEvent(GraphInterpreter.scala:504)
at akka.stream.impl.fusing.GraphInterpreter.execute(GraphInterpreter.scala:378)
at akka.stream.impl.fusing.GraphInterpreterShell.runBatch(ActorGraphInterpreter.scala:588)
at akka.stream.impl.fusing.GraphInterpreterShell$AsyncInput.execute(ActorGraphInterpreter.scala:472)
at akka.stream.impl.fusing.GraphInterpreterShell.processEvent(ActorGraphInterpreter.scala:563)
at akka.stream.impl.fusing.ActorGraphInterpreter.akka$stream$impl$fusing$ActorGraphInterpreter$$processEvent(ActorGraphInterpreter.scala:
Run Code Online (Sandbox Code Playgroud)
Kno*_*uch 20
好的。我想到了。问题是配置文件格式错误。线条
db.default.driver=org.postgresql.Driver
db.default.username=scalauser
db.default.password=******
Run Code Online (Sandbox Code Playgroud)
应该写成
db.default.driver="org.postgresql.Driver"
db.default.username="scalauser"
db.default.password="password"
Run Code Online (Sandbox Code Playgroud)
但有趣的是,与其说应用程序 conf 文件缺少" 播放框架,不如说抛出一个非常神秘的错误消息。
| 归档时间: |
|
| 查看次数: |
3139 次 |
| 最近记录: |