如何重新处理java.lang.ClassCastException:org.slf4j.impl.SimpleLoggerFactory无法转换为ch.qos.logback.classic.LoggerContext问题?

时间:2019-01-23 12:07:45

标签: scala playframework playframework-2.6

对于使用scala的游戏框架,出现以下错误且无法找到原因

        [error] java.lang.ClassCastException: org.slf4j.impl.SimpleLoggerFactory cannot be cast to ch.qos.logback.classic.LoggerContext
        [error]     at play.api.libs.logback.LogbackLoggerConfigurator.configure(LogbackLoggerConfigurator.scala:92)
        [error]     at play.api.libs.logback.LogbackLoggerConfigurator.init(LogbackLoggerConfigurator.scala:31)
        [error]     at play.core.server.DevServerStart$.$anonfun$mainDev$1(DevServerStart.scala:88)
        [error]     at play.utils.Threads$.withContextClassLoader(Threads.scala:21)
        [error]     at play.core.server.DevServerStart$.mainDev(DevServerStart.scala:59)
        [error]     at play.core.server.DevServerStart$.mainDevHttpMode(DevServerStart.scala:49)
        [error]     at play.core.server.DevServerStart.mainDevHttpMode(DevServerStart.scala)
        [error]     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        [error]     at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        [error]     at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        [error]     at java.lang.reflect.Method.invoke(Method.java:498)
        [error]     at play.runsupport.Reloader$.startDevMode(Reloader.scala:229)
        [error]     at play.sbt.run.PlayRun$.devModeServer$lzycompute$1(PlayRun.scala:95)
        [error]     at play.sbt.run.PlayRun$.devModeServer$1(PlayRun.scala:79)
        [error]     at play.sbt.run.PlayRun$.$anonfun$playRunTask$3(PlayRun.scala:102)
        [error]     at play.sbt.run.PlayRun$.$anonfun$playRunenter code hereTask$3$adapted(PlayRun.scala:65)
        [error]     at scala.Function1.$anonfun$compose$1(Function1.scala:44)
        [error] (Compile / run) java.lang.reflect.InvocationTargetException
        [error] Total time: 1 s, completed Jan 23, 2019 6:59:36 PM

0 个答案:

没有答案