Scala 剪影无法验证

Scala silhouette cannot authenticate

我正在尝试使用 Scala Silhouette slick seed 模板在 Play 中实施身份验证。在身份验证时(当您单击登录时)- 我在控制台中收到此错误。关于从哪里着手解决这个问题的任何想法?我必须指出,我对 Silhouette 和 Scala 系统本身还很陌生。

[error] a.a.ActorSystemImpl - Uncaught fatal error from thread [application-akka.actor.default-dispatcher-3] shutting down ActorSystem [application]
java.lang.NoSuchMethodError: play.api.libs.functional.syntax.package$.functionalCanBuildApplicative(Lplay/api/libs/functional/Applicative;)Lplay/api/libs/functional/FunctionalCanBuild;
    at com.mohiva.play.silhouette.impl.authenticators.CookieAuthenticator$.<init>(CookieAuthenticator.scala:92)
    at com.mohiva.play.silhouette.impl.authenticators.CookieAuthenticator$.<clinit>(CookieAuthenticator.scala)
    at com.mohiva.play.silhouette.impl.authenticators.CookieAuthenticatorService.init(CookieAuthenticator.scala:229)
    at com.mohiva.play.silhouette.impl.authenticators.CookieAuthenticatorService.init(CookieAuthenticator.scala:148)
    at controllers.CredentialsAuthController$$anonfun$authenticate$$anonfun$apply$$anonfun$apply$$anonfun$apply$$anonfun$apply.apply(CredentialsAuthController.scala:72)
    at controllers.CredentialsAuthController$$anonfun$authenticate$$anonfun$apply$$anonfun$apply$$anonfun$apply$$anonfun$apply.apply(CredentialsAuthController.scala:70)
    at scala.concurrent.Future$$anonfun$flatMap.apply(Future.scala:251)
    at scala.concurrent.Future$$anonfun$flatMap.apply(Future.scala:249)
    at scala.concurrent.impl.CallbackRunnable.run(Promise.scala:32)
    at akka.dispatch.BatchingExecutor$AbstractBatch.processBatch(BatchingExecutor.scala:55)

方法本身:

def authenticate = Action.async { implicit request =>
    SignInForm.form.bindFromRequest.fold(
      form => Future.successful(BadRequest(views.html.signIn(form))),
      data => {
        val credentials = Credentials(data.email, data.password)
        credentialsProvider.authenticate(credentials).flatMap { loginInfo =>
          val result = Redirect(routes.ApplicationController.index())
          userService.retrieve(loginInfo).flatMap {
            case Some(user) =>
              val c = configuration.underlying
              env.authenticatorService.create(loginInfo).map {
                case authenticator if data.rememberMe =>
                  authenticator.copy(
                    expirationDateTime = clock.now + c.as[FiniteDuration]("silhouette.authenticator.rememberMe.authenticatorExpiry"),
                    idleTimeout = c.getAs[FiniteDuration]("silhouette.authenticator.rememberMe.authenticatorIdleTimeout"),
                    cookieMaxAge = c.getAs[FiniteDuration]("silhouette.authenticator.rememberMe.cookieMaxAge")
                  )
                case authenticator => authenticator
              }.flatMap { authenticator =>
                env.eventBus.publish(LoginEvent(user, request, request2Messages))
                env.authenticatorService.init(authenticator).flatMap { v =>
                  env.authenticatorService.embed(v, result)
                }
              }
            case None => Future.failed(new IdentityNotFoundException("Couldn't find user"))
          }
        }.recover {
          case e: ProviderException =>
            Redirect(routes.ApplicationController.signIn()).flashing("error" -> Messages("invalid.credentials"))
        }
      }
    )
  }

这是到-

的行异常引脚
env.authenticatorService.embed(v, result) 

问题是Silhouette 3.0 和Play 2.5.3 不兼容。将 Silhouette 升级到 4.0 Beta4 并进行一些更改后 运行。