value getControllerInstance不是play.api.GlobalSettings with play 2.4的成员

时间:2015-07-03 04:18:15

标签: playframework

将play框架升级到2.4后,发生以下错误。我已阅读2.4中删除GlobalSettings的文档。但是如何重写下面的代码?

错误

Global.scala:44: value getControllerInstance is not a member of play.api.GlobalSettings

代码

override def getControllerInstance[A](controllerClass: Class[A]): A = {
     val instance = controllerClass.getConstructors.find { c =>
     val params = c.getParameterTypes
     params.length == 1 && params(0) == classOf[RuntimeEnvironment[DemoUser]]
}.map {
     _.asInstanceOf[Constructor[A]].newInstance(DemoRuntimeEnvironment)
}
instance.getOrElse(super.getControllerInstance(controllerClass))

}

1 个答案:

答案 0 :(得分:1)

我认为您正在使用Play 2.4目前不支持的SecureSocial插件

请参阅Issue #556