So it should work this way? This is the info I need, then I can start debugging...
The app starts normally. But as soon as I uncomment any of the injected mailer actors in more than one controller I get this error.
In this case it was in the controllers.Mail, not in controllers.Application. There I also tried it once.
Sorry, but I cant reduce it to a reproducible example, the actual signatures of everything are of course more complicated.
@Singleton
class Application(env: Environment,
gulpAssets: GulpAssets,
lifecycle: ApplicationLifecycle,
dbConfigProvider: DatabaseConfigProvider,
override val betterDb: BetterDb,
val messagesApi: MessagesApi,
val cache: CacheApi,
configuration: Configuration,
system: ActorSystem,
// @Named("mailer") mailer: ActorRef,
router: => Option[Router] = None) extends Controller with Security with I18nSupport {
// Router needs to be wrapped by Provider to avoid circular dependency when doing DI
@Inject
def this(env: Environment, gulpAssets: GulpAssets,
lifecycle: ApplicationLifecycle,
dbConfigProvider: DatabaseConfigProvider,
betterDb: BetterDb,
messagesApi: MessagesApi,
cache: CacheApi,
configuration: Configuration,
// mailer: ActorRef,
system: ActorSystem,
router: Provider[Router]) =
this(env, gulpAssets, lifecycle,
dbConfigProvider, betterDb,
messagesApi, cache, configuration, system, Some(router.get))