Hibernate 3: org.slf4j.impl.StaticLoggerBinder

I have recently downloaded the latest Hibernate 3 binary: [version 3.3.1].

I was writing up a test to verify my DAO + hibernate mapping against an in-memory HSQLDB.

I added the hibernate3.jar and all its dependencies to my classpath yet when i executed the test i got the ClassDefNotFound exception for org.slf4j.impl.StaticLoggerBinder.

Looking into the slf4j-api-1.5.2.jar, I could see that there was no impl package! I decided to download the 1.5.2 version of slf4j myself from http://www.slf4j.org/download.html. I unzipped the distribution and when looking in at the source package of slf4j-api saw that the impl package existed but did not exist in the slf4j-api-1.5.2.jar that is part of the distribution.

So looking inside the slf4j-simple-1.5.2.jar that is also part of slf4j-1.5.2 download, I could see that it had a impl package, so I added this to my classpath along with slf4j-api-1.5.2.jar and that stopped the ClassDefNotFound problem.

Not sure that this is correct thing to do but couldn’t find anything better in my quick qoogle searches.

Advertisements

Tags: ,

13 Responses to “Hibernate 3: org.slf4j.impl.StaticLoggerBinder”

  1. Kaustabh Says:

    Experienced the same problem. Same solution. Thanks a lot.

  2. dros Says:

    For me too. Thank you! (But i don’t understand why this classes aren’t in the hibernate-lib-folder?! Strange!)

  3. Tanawat Says:

    Thanks a lot. As droc says, why this one doesn’t exist in hibernate’s lib?

  4. krishna Says:

    Experienced the same issue. Thx a lot.

  5. qba Says:

    This org.slf4j.impl.StaticLoggerBinder class is available in slf4j-jdk14-{version}.jar
    This jar contains all classes from ‘impl’ package.

  6. lwpro2 Says:

    seems tis is the way to solve it. if using log4j, then can use slf-log4j jars.
    the hibernate set up is so tedious…

  7. Brad Says:

    Ditto. Thanks for solving my problem.

  8. Brad Says:

    org.slf4j
    slf4j-simple
    1.5.8
    jar
    runtime

  9. Brad Says:

    Xdependency>
    XgroupId>org.slf4jX/groupId>
    XartifactId>slf4j-simpleX/artifactId>
    Xversion>1.5.8X/version>
    Xtype>jarX/type>
    Xscope>runtimeX/scope>
    X/dependency>

    (pom.xml entry you need..
    Replace ‘X’ with ‘<')

  10. dinesh Says:

    hi

    i also facing the same problem. by your solution i am able to resolve my prob . thanks a lot.

  11. crimson-rain Says:

    This is very interesting because I have experienced this and I STILL get:

    SLF4J: Failed to load class “org.slf4j.impl.StaticLoggerBinder”.
    SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.
    Exception in thread “main” java.lang.NoClassDefFoundError: org/slf4j/impl/StaticLoggerBinder

    Even with the all the proper jars (I’m using log4j so I have slf4j-api-1.5.8.jar and slf4j-log4j12-1.5.8.jar in my classpath). I’ve googled this to death, and tried a trick with switching to an older version of slf4j (1.5.2 to be precise). Same error. I’ve tried Hibernate 3.3.2 and 3.6 getting the same results.

    I’ve looked in the jar and the class is there, but it just isn’t getting loaded. Any answers???

  12. Stephen McConnell Says:

    The person that designed slf4j and then let them NOT be backwards compatible should be …..

    I am using several different third party pieces of software that use 1.5 or 1.6….. The two are not compatible…… and I can’t seem to get the features I need AND get compatible versions.

    I thought we developed in Java to get out of Microsoft DLL hell.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s


%d bloggers like this: