Pass executionContext to the AuthDAO in Silhouette 6

I am trying to migrate an existing app using Slick to Play 2.7/Silhouette 6.
Everything compiles but I get this error when signing in:

[error] application - Unexpected error
java.lang.IllegalStateException: Cannot initialize ExecutionContext; AsyncExecutor already shut down
	at slick.util.AsyncExecutor$$anon$1.executionContext$lzycompute(AsyncExecutor.scala:69)
	at slick.util.AsyncExecutor$$anon$1.executionContext(AsyncExecutor.scala:67)
	at slick.util.AsyncExecutor$$anon$1.executionContext(AsyncExecutor.scala:51)
	at slick.jdbc.JdbcBackend$DatabaseDef.synchronousExecutionContext(JdbcBackend.scala:62)
	at slick.basic.BasicBackend$DatabaseDef.runSynchronousDatabaseAction(BasicBackend.scala:265)
	at slick.basic.BasicBackend$DatabaseDef.runSynchronousDatabaseAction$(BasicBackend.scala:263)
	at slick.jdbc.JdbcBackend$DatabaseDef.runSynchronousDatabaseAction(JdbcBackend.scala:37)
	at slick.basic.BasicBackend$DatabaseDef.slick$basic$BasicBackend$DatabaseDef$$runInContextInline(BasicBackend.scala:242)
	at slick.basic.BasicBackend$DatabaseDef.runInContextSafe(BasicBackend.scala:148)
	at slick.basic.BasicBackend$DatabaseDef.runInContext(BasicBackend.scala:142)

I guess I am not passing the Play! execution context directly, but I am not sure how.
Here is my code:


Any idea? I could not find any seed up to date unfortunately :frowning: (apart from the one in memory which does not require an execution context).

For me it looks good, expect that you use the implicit keyword twice in the argument definition of your DAO.

It should be:

class OAuth2InfoDAO @Inject() (protected val dbConfigProvider: DatabaseConfigProvider)(
  implicit
  val ex: ExecutionContext,
  val classTag: ClassTag[OAuth2Info]
)

Ah yes, bad copy and paste. Unfortunately I am still hitting the same issue. I only did a few adaptations to migrate, but the code worked fine with silhouette 5/play2.6 :(.

My bad, I had an error before in the logs I did not notice. Everything is ok now!