J'essaie d'utiliser Deadbolt dans mon application Play + Scala (2.5x). J'ajoutés à la suite dans mon build.sbt (Play 2,5x):Obtention d'erreur lorsque Deadbolt est activé
libraryDependencies += "be.objectify" %% "deadbolt-scala" % "2.5.1"
Et dans ma conf/application.conf:
enabled += "be.objectify.deadbolt.scala.DeadboltModule"
Après "run SBT" quand j'accéder au serveur, je me suis immédiatement obtenir cette erreur:
play.api.UnexpectedException: Unexpected exception[CreationException: Unable to create injector, see the following errors:
1) No implementation for be.objectify.deadbolt.scala.cache.HandlerCache was bound.
while locating be.objectify.deadbolt.scala.cache.HandlerCache
for parameter 1 at be.objectify.deadbolt.scala.ActionBuilders.<init>(ActionBuilders.scala:30)
at be.objectify.deadbolt.scala.DeadboltModule.bindings(DeadboltModule.scala:32):
Binding(class be.objectify.deadbolt.scala.ActionBuilders to self) (via modules: com.google.inject.util.Modules$OverrideModule -> play.api.inject.guice.GuiceableModuleConversions$$anon$1)
2) No implementation for be.objectify.deadbolt.scala.cache.HandlerCache was bound.
while locating be.objectify.deadbolt.scala.cache.HandlerCache
for parameter 1 at be.objectify.deadbolt.scala.DeadboltActions.<init>(DeadboltActions.scala:34)
at be.objectify.deadbolt.scala.DeadboltModule.bindings(DeadboltModule.scala:30):
Binding(class be.objectify.deadbolt.scala.DeadboltActions to self) (via modules: com.google.inject.util.Modules$OverrideModule -> play.api.inject.guice.GuiceableModuleConversions$$anon$1)
2 errors]
at play.core.server.DevServerStart$$anonfun$mainDev$1$$anon$1$$anonfun$get$1$$anonfun$apply$1$$anonfun$1.apply(DevServerStart.scala:180)
at play.core.server.DevServerStart$$anonfun$mainDev$1$$anon$1$$anonfun$get$1$$anonfun$apply$1$$anonfun$1.apply(DevServerStart.scala:131)
at scala.Option.map(Option.scala:146)
at play.core.server.DevServerStart$$anonfun$mainDev$1$$anon$1$$anonfun$get$1$$anonfun$apply$1.apply(DevServerStart.scala:131)
at play.core.server.DevServerStart$$anonfun$mainDev$1$$anon$1$$anonfun$get$1$$anonfun$apply$1.apply(DevServerStart.scala:129)
at scala.util.Success.flatMap(Try.scala:231)
Il n'y a pas d'autre changement de code que j'ai fait. Pourquoi devrait-il échouer même si je n'ai encore écrit aucune ligne de code pour utiliser Deadbolt?
Merci. Va ajouter ça. – NKM
Si cela fonctionne: Veuillez marquer comme réponse. –
Merci. Fonctionne comme répondu ci-dessus. – NKM