升级scala play slick 1.0.0到2.0.0

时间:2016-04-26 02:55:17

标签: scala playframework slick slick-2.0

当我将Slick 1.0.0升级到2.0.0时,我遇到了问题:

SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
SLF4J: Defaulting to no-operation (NOP) logger implementation
SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.
Play fork run has failed due to:
java.lang.reflect.InvocationTargetException
    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:497)
    at play.runsupport.Reloader$.startDevMode(Reloader.scala:223)
    at play.forkrun.ForkRun$.startServer(ForkRun.scala:82)
    at play.forkrun.ForkRun.run(ForkRun.scala:177)
    at play.forkrun.ForkRun$$anonfun$settingUp$1.applyOrElse(ForkRun.scala:166)
    at akka.actor.Actor$class.aroundReceive(Actor.scala:465)
    at play.forkrun.ForkRun.aroundReceive(ForkRun.scala:152)
    at akka.actor.ActorCell.receiveMessage(ActorCell.scala:516)
    at akka.actor.ActorCell.invoke(ActorCell.scala:487)
    at akka.dispatch.Mailbox.processMailbox(Mailbox.scala:254)
    at akka.dispatch.Mailbox.run(Mailbox.scala:221)
    at akka.dispatch.Mailbox.exec(Mailbox.scala:231)
    at scala.concurrent.forkjoin.ForkJoinTask.doExec(ForkJoinTask.java:260)
    at scala.concurrent.forkjoin.ForkJoinPool$WorkQueue.pollAndExecAll(ForkJoinPool.java:1253)
    at scala.concurrent.forkjoin.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:1346)
    at scala.concurrent.forkjoin.ForkJoinPool.runWorker(ForkJoinPool.java:1979)
    at scala.concurrent.forkjoin.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:107)
Caused by: 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)
    ... 20 more

我该怎么办?

1 个答案:

答案 0 :(得分:0)

您是否已将Play Framework升级到2.5.x?

更新project / plugins.sbt中的Play版本号以升级Play:

addSbtPlugin("com.typesafe.play" % "sbt-plugin" % "2.5.x")

请参阅https://www.playframework.com/documentation/2.5.x/Migration25