Как исправить SLF4J: путь к классу содержит несколько привязок SLF4J при запуске Play 2.3.x?

Я обновил свою версию Play и других библиотек и теперь вижу это:

SLF4J: Class path contains multiple SLF4J bindings.
SLF4J: Found binding in [jar:file:/home/paul/.ivy2/cache/org.slf4j/slf4j-nop/jars/slf4j-nop-1.7.7.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [jar:file:/home/paul/.ivy2/cache/org.slf4j/slf4j-jdk14/jars/slf4j-jdk14-1.7.7.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [jar:file:/home/paul/.ivy2/cache/org.slf4j/slf4j-simple/jars/slf4j-simple-1.7.7.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation.
SLF4J: Actual binding is of type [org.slf4j.helpers.NOPLoggerFactory]

Я пытаюсь отследить, откуда они берутся, но когда я запускаю show managed-classpath, единственными банками slf4j являются

/home/paul/.ivy2/cache/org.slf4j/slf4j-api/jars/slf4j-api-1.7.6.jar
/home/paul/.ivy2/cache/org.slf4j/jul-to-slf4j/jars/jul-to-slf4j-1.7.6.ja
/home/paul/.ivy2/cache/org.slf4j/jcl-over-slf4j/jars/jcl-over-slf4j-1.7.6.jar

Я никогда не вижу slf4j-nop-1.7.7.jar, slf4j-jdk14-1.7.7.jar или slf4j-simple-1.7.7.jar.

Как они на пути к классам?


person Paul Draper    schedule 08.08.2014    source источник
comment
Это известная проблема (уже зарегистрирована в системе отслеживания проблем).   -  person cchantep    schedule 09.08.2014
comment
@applicius Не могли бы вы прислать нам ссылку?   -  person IsKernel    schedule 09.08.2014
comment
github.com/playframework/playframework/issues/3206   -  person cchantep    schedule 09.08.2014


Ответы (1)


После комментариев и возможных решений могу предложить свой для включения в build.sbt для пользователей версий без фикса, т.е. Играть 2.3.2:

libraryDependencies ++= Seq(
  "org.slf4j" % "slf4j-api"       % "1.7.7",
  "org.slf4j" % "jcl-over-slf4j"  % "1.7.7"
).map(_.force())

libraryDependencies ~= { _.map(_.exclude("org.slf4j", "slf4j-jdk14")) }

До:

--- (Running the application from SBT, auto-reloading is enabled) ---

[info] play - Listening for HTTP on /0:0:0:0:0:0:0:0:9000

(Server started, use Ctrl+D to stop and go back to the console...)

SLF4J: Class path contains multiple SLF4J bindings.
SLF4J: Found binding in [jar:file:/Users/jacek/.ivy2/cache/org.slf4j/slf4j-nop/jars/slf4j-nop-1.7.7.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [jar:file:/Users/jacek/.ivy2/cache/org.slf4j/slf4j-jdk14/jars/slf4j-jdk14-1.7.7.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [jar:file:/Users/jacek/.ivy2/cache/org.slf4j/slf4j-simple/jars/slf4j-simple-1.7.7.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation.
SLF4J: Actual binding is of type [org.slf4j.helpers.NOPLoggerFactory]
[info] play - Application started (Dev)

После (с изменением):

--- (Running the application from SBT, auto-reloading is enabled) ---

[info] play - Listening for HTTP on /0:0:0:0:0:0:0:0:9000

(Server started, use Ctrl+D to stop and go back to the console...)

[info] play - Application started (Dev)

Это зависимости проекта:

$ show libraryDependencies [info] List(org.scala-lang:scala-library:2.11.2, com.typesafe.play:twirl-api:1.0.2, com.typesafe.play:play:2.3.2, com.typesafe.play:play-test:2.3.2:test, com.typesafe.play:play-docs:2.3.2:docs, com.typesafe.play:play-jdbc:2.3.2, com.typesafe.play:anorm:2.3.2, com.typesafe.play:play-cache:2.3.2, com.typesafe.play:play-ws:2.3.2, com.typesafe.play:filters-helpers:2.3.2, org.webjars:webjars-play:2.3.0, org.webjars:requirejs:2.1.14-1, org.webjars:underscorejs:1.6.0-3, org.webjars:jquery:2.1.1, org.webjars:bootstrap:3.2.0, org.webjars:angularjs:1.3.0-beta.17, org.postgresql:postgresql:9.3-1102-jdbc41, org.slf4j:slf4j-api:1.7.7, org.slf4j:jcl-over-slf4j:1.7.7)

person Jacek Laskowski    schedule 09.08.2014