I'm building a web app using Play 2.6 and ReactiveMongo 0.13. But when I try to run the app, I get this output:
ProvisionException: Unable to provision, see the following errors:
1) No implementation for play.modules.reactivemongo.ReactiveMongoApi was bound.
while locating play.modules.reactivemongo.ReactiveMongoApi
for the 2nd parameter of controllers.Employees.<init>(Employees.scala:17)
...
1 error
The class this error refers to is declared with this constructor:
class Employees @Inject() (cc: ControllerComponents,
val reactiveMongoApi: ReactiveMongoApi,
implicit val materializer: akka.stream.Materializer
)
ReactiveMongo
is specified and is supposed to be injected.
I read on the web that the solution is to add the following line to application.conf
:
play.modules.enabled += "play.modules.reactivemongo.ReactiveMongoModule"
The thing is that I did that, but I still get the dependency injection error. I'm not sure where to proceed from here.