[Java-2.5.2] SimpleLoggerFactory cannot be cast to ch.qos.logback.classic.LoggerContext

3,994 views
Skip to the first unread message

Johan Dahlberg

unread,
20 Apr 2016, 08:09:3020/04/2016
to play-framework
I get the following errors since upgrading to 2.5.2. I got different errors on 2.5.0 and 2.5.1 so I'm not sure this begun in 2.5.2.

Anyone that knows the problem? I use the default logger XML:s listed in the documentation.

java.lang.ClassCastException: org.slf4j.impl.SimpleLoggerFactory cannot be cast to ch.qos.logback.classic.LoggerContext
at play.api.libs.logback.LogbackLoggerConfigurator.configure(LogbackLoggerConfigurator.scala:77)
at play.api.libs.logback.LogbackLoggerConfigurator.init(LogbackLoggerConfigurator.scala:26)
at play.core.server.DevServerStart$$anonfun$mainDev$1.apply(DevServerStart.scala:90)
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:497)
at play.runsupport.Reloader$.startDevMode(Reloader.scala:233)
at play.sbt.run.PlayRun$$anonfun$playRunTask$1$$anonfun$apply$2$$anonfun$apply$3.devModeServer$lzycompute$1(PlayRun.scala:74)
at play.sbt.run.PlayRun$$anonfun$playRunTask$1$$anonfun$apply$2$$anonfun$apply$3.play$sbt$run$PlayRun$$anonfun$$anonfun$$anonfun$$devModeServer$1(PlayRun.scala:74)
at play.sbt.run.PlayRun$$anonfun$playRunTask$1$$anonfun$apply$2$$anonfun$apply$3.apply(PlayRun.scala:100)
at play.sbt.run.PlayRun$$anonfun$playRunTask$1$$anonfun$apply$2$$anonfun$apply$3.apply(PlayRun.scala:53)
at scala.Function1$$anonfun$compose$1.apply(Function1.scala:47)
[trace] Stack trace suppressed: run last compile:run for the full output.
[error] (compile:run) java.lang.reflect.InvocationTargetException
[error] Total time: 0 s, completed Apr 20, 2016 2:05:29 PM



Will Sargent

unread,
20 Apr 2016, 13:58:4720/04/2016
to play-fr...@googlegroups.com
You have a competing SLF4J implementation in your classpath -- SimpleLoggerFactory belongs to slf4j-simple, and you should only have logback in your path.

Use https://github.com/jrudolph/sbt-dependency-graph to show all of your dependencies and then use exclude to make sure that sbt-simple and therefore the SimpleLoggerFactory class is not in your classpath.


Will.

--
You received this message because you are subscribed to the Google Groups "play-framework" group.
To unsubscribe from this group and stop receiving emails from it, send an email to play-framewor...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/play-framework/0b361aea-d5eb-4a0d-91da-bf3af1c678df%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Johan Dahlberg

unread,
29 Apr 2016, 06:21:5729/04/2016
to play-framework
Thanks, it was com.typesafe:jse that had it as a dependency.

/Johan

shobhit singh

unread,
22 Sept 2016, 03:02:2622/09/2016
to Play Framework
Hi Johan, 
 How you resolved this issue, com.typesafe is an an sbt plugin? while exclude option is only available for library dependency in sbt.

Thanks,
Shobhit

Johan Dahlberg

unread,
5 Oct 2016, 15:08:0705/10/2016
to Play Framework
Sorry for late response, didn't see that you wrote.

I added this line to my build.sbt:
"com.typesafe" %% "jse" % "1.1.2" exclude("org.slf4j", "slf4j-simple"),

/Johan

shobhit singh

unread,
5 Oct 2016, 22:41:2905/10/2016
to play-fr...@googlegroups.com
Thanks Johan for the reply, by hit and trial even I landed on this solution, and its working.


Regards,
Shobhit

--
You received this message because you are subscribed to a topic in the Google Groups "Play Framework" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/play-framework/j9CJ8seAvRQ/unsubscribe.
To unsubscribe from this group and all its topics, send an email to play-framework+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/play-framework/46d84060-8064-4d92-9ce5-f09d856d47bd%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.



--

Regards

Shobhit Singh


Reply all
Reply to author
Forward
0 new messages