Reputation: 1161
After I upgraded play framework to 2.4,the following error occurs. I have read the documentation that the GlobalSettings is removed in 2.4. But how to rewrite the code below?
Error
Global.scala:44: value getControllerInstance is not a member of play.api.GlobalSettings
Code
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))
}
Upvotes: 0
Views: 566
Reputation: 133
I think you are using SecureSocial plugin which is not currently supported with Play 2.4
See Issue #556
Upvotes: 1