Slf4J: Failed to Load Class "Org.Slf4J.Impl.Staticloggerbinder"

SLF4J: Failed to load class org.slf4j.impl.StaticLoggerBinder

I had the same issue with WebSphere 6.1. As Ceki pointed out, there were tons of jars that WebSphere was using and one of them was pointing to an older version of slf4j.

The No-Op fallback happens only with slf4j -1.6+ so anything older than that will throw an exception and halts your deployment.

There is a documentation in SLf4J site which resolves this. I followed that and added slf4j-simple-1.6.1.jar to my application along with slf4j-api-1.6.1.jar which I already had.

If you use Maven, add the following dependencies, with ${slf4j.version} being the latest version of slf4j

<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<version>${slf4j.version}</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-simple</artifactId>
<version>${slf4j.version}</version>
</dependency>

This solved my issue.

Failed to load class org.slf4j.impl.StaticLoggerBinder even though StaticLoggerBinder is in Maven-Rep

slf4j-simple is not your classpath when you ran the program. Put it in your classpath, something like java -classpath ./lib/* YourProgram. Where lib contains your jar files.

How to solve SLF4J: Failed to load class org.slf4j.impl.StaticLoggerBinder in Eclipse Tycho RCP

That depends on how you want to add logging support to your application. If you don't care about logging you can either ignore the warning or add the nop logger or simple logger from eclipse Orbit. The NatTable examples are using the simple binding for example. The target definition consumes the SLF4J binding from Orbit, the E4 example feature includes the bundle.



Related Topics



Leave a reply



Submit