Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

multiple slf4j bindings in Eclipse RCP Plugin

I have a simple Eclipse Plugin which gives me following error on activation:

SLF4J: Class path contains multiple SLF4J bindings.
SLF4J: Found binding in [bundleresource://103.fwk8918249:1/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [bundleresource://103.fwk8918249:4/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation.

both URLs resolve to the exact same jar in the bundle

libs/slf4j-log4j12.jar!/org/slf4j/impl/StaticLoggerBinder.class
  • How can i solve the problem?
  • How come that the bundle loads the jar twice (":1" and ":4")?
like image 673
Absurd-Mind Avatar asked Sep 10 '13 14:09

Absurd-Mind


1 Answers

This is a result of defining an SLF4J binding in both your project's classpath (JDT .classpath file) and your MANIFEST.MF file.

You should remove your SLF4J binding from your project's class path:

YourProject → Properties → Java Build Path → Libraries

  • Select the SLF4J Binding JAR and hit 'Remove'.

Once you do this, there should only be a single reference to your SLF4J binding in your class loader (and thus the error message should not appear).

like image 189
jdknight Avatar answered Oct 07 '22 02:10

jdknight