发现类型不匹配ApplicationWithFilter.this.AuthenticatedRequest [play.api.mvc.AnyContent]必需列表[org.pac4j.core.profile.CommonProfile]

时间:2018-02-25 11:26:29

标签: scala playframework

我是scala的新手,pac4j&玩框架。我正面临以下问题

missing parameter type. type mismatch;
[error]  found   : ApplicationWithFilter.this.AuthenticatedRequest[play.api.mvc.AnyContent]
(which expands to)  org.pac4j.play.scala.AuthenticatedRequest[org.pac4j.core.profile.CommonProfile,play.api.mvc.AnyContent]
[error]  required: List[org.pac4j.core.profile.CommonProfile]
[error]       Ok(views.html.index(profiles, csrfToken, null))
play.sbt.PlayExceptions$CompilationException: Compilation error[missing parameter type]
        at play.sbt.PlayExceptions$CompilationException$.apply(PlayExceptions.scala:30)
        at play.sbt.PlayExceptions$CompilationException$.apply(PlayExceptions.scala:30)
        at scala.Option.map(Option.scala:145)
        at play.sbt.run.PlayReload$$anonfun$taskFailureHandler$1.apply(PlayReload.scala:32)
        at play.sbt.run.PlayReload$$anonfun$taskFailureHandler$1.apply(PlayReload.scala:27)
        at scala.Option.map(Option.scala:145)
        at play.sbt.run.PlayReload$.taskFailureHandler(PlayReload.scala:27)
        at play.sbt.run.PlayReload$.compileFailure(PlayReload.scala:23)
        at play.sbt.run.PlayReload$$anonfun$compile$1.apply(PlayReload.scala:50)
        at play.sbt.run.PlayReload$$anonfun$compile$1.apply(PlayReload.scala:50)***

奇怪的是,我上次使用工作区时没有编译错误。我复制了我的工作区,然后运行了sbt run而不是bin \ activator run。当我加载http://localhost:9000时,我开始面临很多编译问题。 我想这些都是库问题而不是代码。

请让我知道问题是什么以及可能的修复方法。

Build.sbt

name := "play-pac4j-scala-demo"

version := "5.0.0-SNAPSHOT"

lazy val root = (project in file(".")).enablePlugins(PlayScala)

scalaVersion := "2.12.2"

val playPac4jVersion = "5.0.0-SNAPSHOT"
val pac4jVersion = "2.2.0"
val playVersion = "2.6.6"

libraryDependencies ++= Seq(
  guice,
  ehcache, // or cacheApi
  ws,
  filters,
  specs2 % Test,
  "org.pac4j" %% "play-pac4j" % playPac4jVersion,
  "org.pac4j" % "pac4j-http" % pac4jVersion,
  "org.pac4j" % "pac4j-cas" % pac4jVersion,
  "org.pac4j" % "pac4j-openid" % pac4jVersion exclude("xml-apis" , "xml-apis"),
  "org.pac4j" % "pac4j-oauth" % pac4jVersion,
  "org.pac4j" % "pac4j-saml" % pac4jVersion,
  "org.pac4j" % "pac4j-oidc" % pac4jVersion exclude("commons-io" , "commons-io"),
  "org.pac4j" % "pac4j-gae" % pac4jVersion,
  "org.pac4j" % "pac4j-jwt" % pac4jVersion exclude("commons-io" , "commons-io"),
  "org.pac4j" % "pac4j-ldap" % pac4jVersion,
  "org.pac4j" % "pac4j-sql" % pac4jVersion,
  "org.pac4j" % "pac4j-mongo" % pac4jVersion,
  "org.pac4j" % "pac4j-kerberos" % pac4jVersion,
  "org.pac4j" % "pac4j-couch" % pac4jVersion,
  "com.typesafe.play" % "play-cache_2.12" % playVersion,
  "commons-io" % "commons-io" % "2.5"
)

resolvers ++= Seq(Resolver.mavenLocal, "scalaz-bintray" at "http://dl.bintray.com/scalaz/releases", "Sonatype snapshots repository" at "https://oss.sonatype.org/content/repositories/snapshots/")

routesGenerator := InjectedRoutesGenerator

fork in run := true

由于 普里

0 个答案:

没有答案