1

After compiling my java code under Eclipse, I got the following error messages:

SLF4J: Class path contains multiple SLF4J bindings. SLF4J: Found binding in [jar:file:/home/user1/workspace/MC/lib/slf4j-nop-1.5.8.jar!/org/slf4j/impl/StaticLoggerBinder.class] SLF4J: Found binding in [jar:file:/home/user1/workspace/stable/lib/org.slf4j/slf4j-log4j12-1.6.1.jar!/org/slf4j/impl/StaticLoggerBinder.class]

t seems to me that the two slf4j*.jar files cause the conflict. I tried to remove one jar file from the built path. After clicking “build path->Configure build path”, selecting the “Libraries” tab, I could not find any library matching home/user1/workspace/stable/lib/org.slf4j/slf4j-log4j12-1.6.1.jar”

If there does not have this file, why it causes conflict?

bit-question
  • 3,733
  • 17
  • 50
  • 63

1 Answers1

1

It could be possible that another jar on your buildpath contains a version of slf4j, which is different than the one you expect. Rearrange your Also, Per SLF4J docs, this should be a warning and not an error.

http://www.slf4j.org/codes.html

Note that the warning emitted by SLF4J is just that, a warning. SLF4J will still bind with the first framework it finds on the class path.

You should be able to put the SLF4J on top of your library ordering (Configure build path, Order and Export tab), so that you know it is using the version you expect it to. However, I would prefer finding where the conflict is and proceeding from there.

Joseph
  • 1,442
  • 21
  • 44
  • Joseph, may you elaborate on what do you mean the "put the SLF4J on top of your library ordering"? – bit-question May 25 '11 at 03:06
  • I assume you have an explicit SLF4J jar and then some other jar is lurking out there causing this conflict. If you go to “build path->Configure build path” then click the Order and Export tab, move the SLF4J jar that you have all the way up to the top. If you aren't explicitly using SLF4J, then it sounds like 2 jars that you have imported each have the SLF4J jar in them (but different versions). I could be wrong, but this is the issue I've seen with class conflicts. – Joseph May 25 '11 at 14:13
  • Did you figure out the issue? – Joseph May 25 '11 at 17:18