内部流动完成,没有产生1个突出元素的结果元素



我有一个可工作的play框架应用程序。我尝试在应用程序上启用数据库进化支持。我通过添加以下设置更改了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

数据库存在,我可以使用类似sql -U scalauser -d scaladb的命令连接到它

我在AppLoader类中添加了以下几行,以设置数据库并运行迁移

val onStart = {
applicationEvolutions
DBs.setupAll()
}
applicationLifecycle.addStopHook{() => 
DBs.closeAll()
Future.successful(Unit)
}

但现在,当我用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:

好。我想明白了。问题是配置文件格式不正确。线路

db.default.driver=org.postgresql.Driver
db.default.username=scalauser
db.default.password=******

应写成

db.default.driver="org.postgresql.Driver"
db.default.username="scalauser"
db.default.password="password"

但有趣的是,与其说应用程序conf文件缺少",不如说play框架抛出了一条非常神秘的错误消息。

通过回答这个问题,我想强调对已接受答案的评论。

仔细检查application.conf文件中定义的环境变量。在我的例子中,我有一个未定义的环境变量。我的解决方案是在kubernetes pod配置yaml中添加定义。

相关内容

最新更新