gpt4 book ai didi

playframework - 关于 Playframework Global

转载 作者:行者123 更新时间:2023-12-02 01:56:53 28 4
gpt4 key购买 nike

我在 Global.scala 和 application.conf application.global=Global 中添加了一些代码

object Global extends WithFilters(new GzipFilter()) with GlobalSettings {
override def onStart(app: Application) {
Logger.info("Application started.")
}

override def onStop(app: Application) {
Logger.info("Application shutdown...")
}
}

为什么要在控制台运行 3 次?

[info] application - Application started.
[info] application - Application started.
[info] application - Application started.
[info] wobo - Application started (Dev)
[WARN] [10/21/2013 15:54:50.591] [New I/O worker #1] [EventStream(akka://play)]akka.event-handlers] config is deprecated, use [akka.loggers]
[info] application - Application shutdown...
[info] application - Application shutdown...
[info] application - Application shutdown...

最佳答案

OnStart is might called multiple times because you have dependencies to Play plugins that are older than your application Play version.

您可以在 SBT 中排除较旧的 Play 依赖项,例如如何在 build.sbt 或 Build.scala 中为类型安全的邮件插件执行此操作:

 "com.typesafe" %% "play-plugins-mailer" % "2.2.0" exclude ("org.scala-stm", "scala-stm_2.10.0") exclude("play", "*")

我认为这是因为 Play 有一个新的 Group ID所以 SBT 不会将其识别为同一个库。

关于playframework - 关于 Playframework Global,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19489192/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com