I'm trying to make some little improvements to play-silhouette-seed sample with the purpose of avoiding manually creation of tables in postgres. I tried to follow the implementation used in
https://github.com/playframework/play-slick/tree/master/samples/computer-database
, but I'm having some issues with injection when I add a bind(classOf[InitialData]).asEagerSingleton() to a InitialData class. I get: Error injecting constructor, java.lang.RuntimeException: There is no started application. I uploaded the tentative app in
https://github.com/renexdev/Play-Auth-Slick-Seed-Load-Schema
. I modified some methods in UserImpl.scala but the important file is the /app/modules/InitialData.scala which is called by the Abstract Module in a bind(classOf[InitialData]).asEagerSingleton() when app starts.
I was suggested to pass an execution context to the initialData class. I tried the
def doSomething(implicit ec: ExecutionContext)
suggested in
https://github.com/alexandru/scala-best-practices/blob/master/sections/4-concurrency-parallelism.md
and the import play.api.libs.concurrent.Execution.Implicits._ suggested in
Play Framework 2.1 - Cannot find an implicit ExecutionContext
but without success. I would appreciate if anyone could give me some insights on what could be wrong with the injection or with the constructor. Thanks for your time. ReneX