Play [2.5.2] attempted duplicate class definition for name: "org/slf4j/impl/StaticLoggerBinder"

1,189 views
Skip to first unread message

Manoj Santhakumaran

unread,
Jul 26, 2016, 2:41:03 AM7/26/16
to play-framework
Hi All,

I have upgraded my application from Play 2.4 to 2.5.2. After that I'm getting following error when starting my application.

SLF4J: Actual binding is of type [ch.qos.logback.classic.util.ContextSelectorStaticBinder]
Exception in thread "main" java.lang.LinkageError: loader (instance of  sun/misc/Launcher$AppClassLoader): attempted  duplicate class definition for name: "org/slf4j/impl/StaticLoggerBinder"
        at java
.lang.ClassLoader.defineClass1(Native Method)
        at java
.lang.ClassLoader.defineClass(ClassLoader.java:763)
        at java
.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
        at java
.net.URLClassLoader.defineClass(URLClassLoader.java:467)
        at java
.net.URLClassLoader.access$100(URLClassLoader.java:73)
        at java
.net.URLClassLoader$1.run(URLClassLoader.java:368)
        at java
.net.URLClassLoader$1.run(URLClassLoader.java:362)
        at java
.security.AccessController.doPrivileged(Native Method)
        at java
.net.URLClassLoader.findClass(URLClassLoader.java:361)
        at java
.lang.ClassLoader.loadClass(ClassLoader.java:424)
        at sun
.misc.Launcher$AppClassLoader.loadClass(Launcher.java:331)
        at java
.lang.ClassLoader.loadClass(ClassLoader.java:357)
        at play
.api.libs.logback.LogbackLoggerConfigurator.configure(LogbackLoggerConfigurator.scala:77)
        at play
.api.libs.logback.LogbackLoggerConfigurator.configure(LogbackLoggerConfigurator.scala:59)
        at play
.api.inject.guice.GuiceApplicationBuilder$$anonfun$applicationModule$1.apply(GuiceApplicationBuilder.scala:102)
        at play
.api.inject.guice.GuiceApplicationBuilder$$anonfun$applicationModule$1.apply(GuiceApplicationBuilder.scala:102)
        at scala
.Option.foreach(Option.scala:257)
        at play
.api.inject.guice.GuiceApplicationBuilder.applicationModule(GuiceApplicationBuilder.scala:101)
        at play
.api.inject.guice.GuiceBuilder.injector(GuiceInjectorBuilder.scala:181)
        at play
.api.inject.guice.GuiceApplicationBuilder.build(GuiceApplicationBuilder.scala:123)
        at play
.api.inject.guice.GuiceApplicationLoader.load(GuiceApplicationLoader.scala:21)
        at play
.core.server.ProdServerStart$.start(ProdServerStart.scala:47)
        at play
.core.server.ProdServerStart$.main(ProdServerStart.scala:22)
        at play
.core.server.ProdServerStart.main(ProdServerStart.scala)

Can anyone give any solutions/suggestion/pointer to resolve this error?

Thank you very much.
Manoj

Shrenik Dedhia

unread,
Jul 27, 2016, 12:20:11 AM7/27/16
to play-framework
Running into the same issue. I'm on Play 2.5.4. Here is my dependency tree (the ***** out ones are proprietary project names):
[INFO] --- maven-dependency-plugin:2.8:tree (default-cli) @ ********** ---
[INFO] **********************************
[INFO] +- **********************************
[INFO] |  +- **********************************
[INFO] |  |  +- commons-io:commons-io:jar:2.4:compile
[INFO] |  |  +- commons-codec:commons-codec:jar:1.8:compile
[INFO] |  |  +- **********************************
[INFO] |  |  +- commons-lang:commons-lang:jar:2.6:compile
[INFO] |  |  +- **********************************
[INFO] |  |  +- **********************************
[INFO] |  |  +- **********************************
[INFO] |  |  \- log4j:log4j:jar:1.2.17:compile
[INFO] |  +- **********************************
[INFO] |  |  +- **********************************
[INFO] |  |  \- **********************************
[INFO] |  \- **********************************
[INFO] +- com.typesafe.play:play-logback_2.11:jar:2.5.4:compile
[INFO] |  +- com.typesafe.play:play_2.11:jar:2.5.4:compile
[INFO] |  |  +- com.typesafe.play:build-link:jar:2.5.4:compile
[INFO] |  |  |  \- com.typesafe.play:play-exceptions:jar:2.5.4:compile
[INFO] |  |  +- com.typesafe.play:play-netty-utils:jar:2.5.4:compile
[INFO] |  |  +- com.typesafe.play:play-streams_2.11:jar:2.5.4:compile
[INFO] |  |  |  \- com.typesafe.akka:akka-stream_2.11:jar:2.4.4:compile
[INFO] |  |  |     \- com.typesafe:ssl-config-akka_2.11:jar:0.2.1:compile
[INFO] |  |  |        \- com.typesafe:ssl-config-core_2.11:jar:0.2.1:compile
[INFO] |  |  +- com.typesafe.play:twirl-api_2.11:jar:1.1.1:compile
[INFO] |  |  |  \- org.scala-lang.modules:scala-xml_2.11:jar:1.0.1:compile
[INFO] |  |  +- com.typesafe.akka:akka-slf4j_2.11:jar:2.4.4:compile
[INFO] |  |  +- org.apache.commons:commons-lang3:jar:3.4:compile
[INFO] |  |  +- xerces:xercesImpl:jar:2.11.0:compile
[INFO] |  |  |  \- xml-apis:xml-apis:jar:1.4.01:compile
[INFO] |  |  +- javax.transaction:jta:jar:1.1:compile
[INFO] |  |  +- com.google.inject:guice:jar:4.0:compile
[INFO] |  |  |  +- javax.inject:javax.inject:jar:1:compile
[INFO] |  |  |  \- aopalliance:aopalliance:jar:1.0:compile
[INFO] |  |  +- com.google.inject.extensions:guice-assistedinject:jar:4.0:compile
[INFO] |  |  +- org.scala-lang.modules:scala-java8-compat_2.11:jar:0.7.0:compile
[INFO] |  |  \- org.scala-lang.modules:scala-parser-combinators_2.11:jar:1.0.4:compile
[INFO] |  \- ch.qos.logback:logback-classic:jar:1.1.7:compile
[INFO] |     \- ch.qos.logback:logback-core:jar:1.1.7:compile
[INFO] +- com.typesafe.play:play-netty-server_2.11:jar:2.5.4:compile
[INFO] |  +- com.typesafe.play:play-server_2.11:jar:2.5.4:compile
[INFO] |  +- com.typesafe.netty:netty-reactive-streams-http:jar:1.0.6:compile
[INFO] |  |  +- com.typesafe.netty:netty-reactive-streams:jar:1.0.6:compile
[INFO] |  |  |  \- io.netty:netty-handler:jar:4.0.36.Final:compile
[INFO] |  |  \- io.netty:netty-codec-http:jar:4.0.36.Final:compile
[INFO] |  |     \- io.netty:netty-codec:jar:4.0.36.Final:compile
[INFO] |  \- io.netty:netty-transport-native-epoll:jar:linux-x86_64:4.0.36.Final:compile
[INFO] |     +- io.netty:netty-common:jar:4.0.36.Final:compile
[INFO] |     +- io.netty:netty-buffer:jar:4.0.36.Final:compile
[INFO] |     \- io.netty:netty-transport:jar:4.0.36.Final:compile
[INFO] +- com.typesafe.play:play-ws_2.11:jar:2.5.4:compile
[INFO] |  +- com.google.guava:guava:jar:19.0:compile
[INFO] |  +- org.asynchttpclient:async-http-client:jar:2.0.2:compile
[INFO] |  |  +- org.asynchttpclient:netty-resolver-dns:jar:2.0.2:compile
[INFO] |  |  |  +- org.asynchttpclient:netty-resolver:jar:2.0.2:compile
[INFO] |  |  |  \- org.asynchttpclient:netty-codec-dns:jar:2.0.2:compile
[INFO] |  |  +- org.reactivestreams:reactive-streams:jar:1.0.0:compile
[INFO] |  |  \- org.javassist:javassist:jar:3.20.0-GA:compile
[INFO] |  +- oauth.signpost:signpost-core:jar:1.2.1.2:compile
[INFO] |  \- oauth.signpost:signpost-commonshttp4:jar:1.2.1.2:compile
[INFO] |     +- org.apache.httpcomponents:httpcore:jar:4.0.1:compile
[INFO] |     \- org.apache.httpcomponents:httpclient:jar:4.0.1:compile
[INFO] |        \- commons-logging:commons-logging:jar:1.1.1:compile
[INFO] +- io.kamon:kamon-play-25_2.11:jar:0.6.2:compile
[INFO] +- com.typesafe.akka:akka-agent_2.11:jar:2.4.8:compile
[INFO] |  +- com.typesafe.akka:akka-actor_2.11:jar:2.4.8:compile
[INFO] |  |  \- com.typesafe:config:jar:1.3.0:compile
[INFO] |  \- org.scala-stm:scala-stm_2.11:jar:0.7:compile
[INFO] +- com.typesafe.play:play-json_2.11:jar:2.5.4:compile
[INFO] |  +- com.typesafe.play:play-iteratees_2.11:jar:2.5.4:compile
[INFO] |  +- com.typesafe.play:play-functional_2.11:jar:2.5.4:compile
[INFO] |  +- com.typesafe.play:play-datacommons_2.11:jar:2.5.4:compile
[INFO] |  +- joda-time:joda-time:jar:2.9.2:compile
[INFO] |  +- org.joda:joda-convert:jar:1.8.1:compile
[INFO] |  +- org.scala-lang:scala-reflect:jar:2.11.7:compile
[INFO] |  +- com.fasterxml.jackson.core:jackson-core:jar:2.7.1:compile
[INFO] |  +- com.fasterxml.jackson.core:jackson-annotations:jar:2.7.1:compile
[INFO] |  +- com.fasterxml.jackson.core:jackson-databind:jar:2.7.1:compile
[INFO] |  +- com.fasterxml.jackson.datatype:jackson-datatype-jdk8:jar:2.7.1:compile
[INFO] |  \- com.fasterxml.jackson.datatype:jackson-datatype-jsr310:jar:2.7.1:compile
[INFO] +- io.kamon:kamon-akka_2.11:jar:0.6.2:compile
[INFO] +- io.kamon:kamon-core_2.11:jar:0.6.2:compile
[INFO] |  +- org.hdrhistogram:HdrHistogram:jar:2.1.8:compile
[INFO] |  \- org.slf4j:slf4j-api:jar:1.7.7:compile
[INFO] +- io.kamon:kamon-scala_2.11:jar:0.6.2:compile
[INFO] +- org.aspectj:aspectjweaver:jar:1.8.9:compile
[INFO] +- org.scala-lang:scala-library:jar:2.11.8:compile
[INFO] +- org.slf4j:jcl-over-slf4j:jar:1.7.21:compile
[INFO] +- org.slf4j:jul-to-slf4j:jar:1.7.21:compile
[INFO] \- org.slf4j:log4j-over-slf4j:jar:1.7.21:compile

Manoj Santhakumaran

unread,
Aug 1, 2016, 10:00:26 PM8/1/16
to play-framework
Hi Shrenik,

Thank you very much for your reponse.

I had both "logback-classic" and "slf4j-log4j" jars in my classpath. Issue got resolved when I removed "slf4j-log4j" jar.

Manoj
Reply all
Reply to author
Forward
0 new messages