Intellipaat Back

Explore Courses Blog Tutorials Interview Questions
0 votes
2 views
in Java by (10.2k points)

My application is to be deployed on both tcServer and WebSphere 6.1. This application uses ehCache and so requires slf4j as a dependency. As a result, I've added the slf4j-api.jar (1.6) jar to my war file bundle.

The application works fine in tcServer except for the following error:

SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
SLF4J: Defaulting to no-operation (NOP) logger implementation
SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.

However, when I deploy in WebSphere I get a java.lang.NoClassDefFoundError: org.slf4j.impl.StaticLoggerBinder.

I've checked the classpaths of both application servers and there is no other slf4j jar.

Does anyone have any ideas about what may be happening here?

1 Answer

0 votes
by (46k points)

The reason behind this error is that there were tons of jars that WebSphere was using and one of them was aiming to an older version of slf4j.

The No-Op rollback occurs only with slf4j -1.6+ so anything older than that will deliver an objection and reduces your deployment.

There's documentation in the SLf4J site that resolves this. I followed that and attached slf4j-simple-1.6.1.jar to my application accompanying with slf4j-API-1.6.1.jar which I already had.

I hope this will solve your issue. 

31k questions

32.8k answers

501 comments

693 users

Browse Categories

...