I ran into the same issue with Play 2.4.x. But sparkr's solution wasn't enough, because Play keeps creating new classloaders on each code change. The following hack (in Globals.scala
) seems to fix the issue:
import play.api.{Play, Application, GlobalSettings}
import com.novus.salat.global.{ctx => SalatGlobalContext}
object Global extends GlobalSettings {
override def onStart(app: Application) = {
SalatGlobalContext.clearAllGraters()
SalatGlobalContext.registerClassLoader(Play.classloader(Play.current))
}
}