The tricky thing is I am using Scala and Scaldi rather than Java and Guice. So while this may be a Scaldi question primarily, let me ask here just in case anyone has an insight.
when (inTestMode or inProdMode) {
bind[EnvironmentConfigurationProvider] toNonLazy new EnvironmentConfigurationProvider("REDIS_URL")
bind[Configuration] toNonLazy {
inject[EnvironmentConfigurationProvider].get
}
bind[CacheApi] to injected[SyncRedis]
}
bind[CacheApi] when inDevMode to injected[EhCacheApi]
Again, the binding approach is different with Scaldi compared to Guice, but hopefully this is fairly straightforward. Basically, I am binding CacheApi to different implementations based on mode. This gives me the following exception in Dev though:
InjectException: No binding found with following identifiers:
* TypeTagIdentifier(play.api.cache.redis.EnvironmentConfigurationProvider)
I get the same exception if I remove the bind[CacheApi] lines. The funny thing is that EnvironmentConfigurationProvider is irrelevant in Dev. It is only necessary in Test and Prod when I'm using Redis.
As I said, this may be more of a Scaldi question, but I would appreciate any insight someone has on the caching and general wiring aspect.
Thanks.