我已经升级了build.sbt以使用最新的play-slick(2.0.0),并且在下载并且应用程序设置为运行后我得到了这个例外。
` java.lang.NoSuchMethodError:play.api.Logger $ .init(Ljava / io / File; Lscala / Enumeration $ Value;)V at play.core.server.DevServerStart $$ anonfun $ mainDev $ 1.apply(DevServerStart.scala:88) at play.core.server.DevServerStart $$ anonfun $ mainDev $ 1.apply(DevServerStart.scala:61) at play.utils.Threads $ .withContextClassLoader(Threads.scala:21) at play.core.server.DevServerStart $ .mainDev(DevServerStart.scala:60) at play.core.server.DevServerStart $ .mainDevHttpMode(DevServerStart.scala:50) at play.core.server.DevServerStart.mainDevHttpMode(DevServerStart.scala) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at play.runsupport.Reloader $ .startDevMode(Reloader.scala:207) at play.sbt.run.PlayRun $$ anonfun $ playRunTask $ 1 $$ anonfun $ apply $ 2 $$ anonfun $ apply $ 3.devModeServer $ lzycompute $ 1(PlayRun.scala:73) at play.sbt.run.PlayRun $$ anonfun $ playRunTask $ 1 $$ anonfun $ apply $ 2 $$ anonfun $ apply $ 3.play $ sbt $ run $ PlayRun $$ anonfun $$ anonfun $$ anonfun $$ devModeServer $ 1(PlayRun。斯卡拉:73) at play.sbt.run.PlayRun $$ anonfun $ playRunTask $ 1 $$ anonfun $ apply $ 2 $$ anonfun $ apply $ 3.apply(PlayRun.scala:99) at play.sbt.run.PlayRun $$ anonfun $ playRunTask $ 1 $$ anonfun $ apply $ 2 $$ anonfun $ apply $ 3.apply(PlayRun.scala:52) 在scala.Function1 $$ anonfun $ compose $ 1.apply(Function1.scala:47) [trace]抑制堆栈跟踪:运行最后一次编译:运行完整输出。 [error](compile:run)java.lang.reflect.InvocationTargetException [错误]总时间:0 s,已完成31 /前/ 2016 23:23:25
`
这是我的build.sbt `
版本:=" 1.0-SNAPSHOT"
lazy val root =(项目在文件中("。"))。enablePlugins(PlayScala)
scalaVersion:=" 2.11.7"
libraryDependencies + =" mysql" %" mysql-connector-java" %" 5.1.22"
libraryDependencies ++ = Seq( // JDBC, 缓存, WS, specs2%测试 )
libraryDependencies ++ = Seq( " com.typesafe.play" %%" play-slick" %" 2.0.0", " com.typesafe.play" %%" play-slick-evolutions" %" 2.0.0" )
// libraryDependencies + =" com.typesafe.scala-logging" %%" scala-logging" %" 3.1.0"
libraryDependencies + =" org.slf4j" %" slf4j-api" %" 1.7.21" libraryDependencies + =" org.slf4j" %" slf4j-simple" %" 1.7.21"
解析器+ =" scalaz-bintray" at" http://dl.bintray.com/scalaz/releases"
// Play提供两种样式的路由器,一种期望它的动作被注入, //其他遗留样式,静态访问其动作。 routesGenerator:= InjectedRoutesGenerator
libraryDependencies + =" com.sksamuel.scrimage" %%" scrimage-core" %" 2.1.0"
libraryDependencies + =" com.sksamuel.scrimage" %%" scrimage-io-extra" %" 2.1.0"
libraryDependencies + =" com.sksamuel.scrimage" %%" scrimage-filters" %" 2.1.0"
` 和我的plugins.sbt
` cat project / plugins.sbt // Play插件 addSbtPlugin(" com.typesafe.play"%" sbt-plugin"%" 2.4.0")
//网络插件
addSbtPlugin(" com.typesafe.sbt"%" sbt-coffeescript"%" 1.0.0")
addSbtPlugin(" com.typesafe.sbt"%" sbt-less"%" 1.0.6")
addSbtPlugin(" com.typesafe.sbt"%" sbt-jshint"%" 1.0.3")
addSbtPlugin(" com.typesafe.sbt"%" sbt-rjs"%" 1.0.7")
addSbtPlugin(" com.typesafe.sbt"%" sbt-digest"%" 1.1.0")
addSbtPlugin(" com.typesafe.sbt"%" sbt-mocha"%" 1.1.0")
// offline:= true
` 我已经尝试过禁用依赖项,但这并没有解决问题。
有什么想法吗?
答案 0 :(得分:2)
你的游戏版本" 2.4"似乎与升级的Slick版本不兼容。
//try this instead in your plugins.sbt
addSbtPlugin("com.typesafe.play" % "sbt-plugin" % "2.5.x")