During
val value = Play.current.configuration.getString("confKey")
An exception or error caused a run to abort: There is no started application
java.lang.RuntimeException
: There is no started application
During
val value = Play.current.configuration.getString("confKey")
An exception or error caused a run to abort: There is no started application
java.lang.RuntimeException
: There is no started application
You are accessing the global play instance when using Play.current
. This is incorrect in many cases (during testing you may not have a started application).
You should use dependency injection to inject your configuration.
See: https://www.lagomframework.com/documentation/1.3.x/scala/DependencyInjection.html and https://www.playframework.com/documentation/2.5.x/ScalaDependencyInjection