wood burning stoves 2.0*
The moose likes Other Open Source Projects and the fly likes Exception in thread Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Products » Other Open Source Projects
Bookmark "Exception in thread "main" java.lang.NoClassDefFoundError: org/slf4j/impl/StaticLoggerBinder" Watch "Exception in thread "main" java.lang.NoClassDefFoundError: org/slf4j/impl/StaticLoggerBinder" New topic
Author

Exception in thread "main" java.lang.NoClassDefFoundError: org/slf4j/impl/StaticLoggerBinder

SuvenduSekhar Panda
Greenhorn

Joined: Dec 17, 2013
Posts: 13
Hi

I am new t hibernate while execution I am facing problem saying

LF4J: 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
at org.slf4j.LoggerFactory.getSingleton(LoggerFactory.java:223)
at org.slf4j.LoggerFactory.bind(LoggerFactory.java:120)
at org.slf4j.LoggerFactory.performInitialization(LoggerFactory.java:111)
at org.slf4j.LoggerFactory.getILoggerFactory(LoggerFactory.java:269)
at org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:242)
at org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:255)
at org.hibernate.cfg.Configuration.<clinit>(Configuration.java:152)
at com.holic.jitun.dto.InsertClient.main(InsertClient.java:19)
Caused by: java.lang.ClassNotFoundException: org.slf4j.impl.StaticLoggerBinder
at java.net.URLClassLoader$1.run(Unknown Source)
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
... 8 more


I added Log4j-1.2.17.jar ,slf4j-api-1.7.5.jar and slf4j-log4j12-a.7.5.jar into the classpath

but still the above error is showing.How can I resolve this problem ?
bikasit babu
Greenhorn

Joined: Mar 29, 2012
Posts: 28
Hi ,
can you please be more descriptive at what point you are facing the problem. Or just show your code
Bill Gorder
Bartender

Joined: Mar 07, 2010
Posts: 1648
    
    7

Hello and welcome to the Ranch!

Did you read the contents of the URL linked in the stack trace?
http://www.slf4j.org/codes.html#StaticLoggerBinder

Failedto load class org.slf4j.impl.StaticLoggerBinder

This error is reported when the org.slf4j.impl.StaticLoggerBinder class could not be loaded into memory. This happens when no appropriate SLF4J binding could be found on the class path. Placing one (and only one) of slf4j-nop.jar, slf4j-simple.jar, slf4j-log4j12.jar, slf4j-jdk14.jar or logback-classic.jar on the class path should solve the problem.
SINCE 1.6.0 As of SLF4J version 1.6, in the absence of a binding, SLF4J will default to a no-operation (NOP) logger implementation.
You can download SLF4J bindings from the project download page.


In your case you will want log4j
Make sure all of the versions match up. This becomes easier if you use an automated build tool like Maven. Also make sure you don't have other stuff like commons-logging etc on your classpath.

If you are not using Maven you can still get the necessary jar files from a maven repo. Just make sure you use the same version for everything
http://mvnrepository.com/artifact/org.slf4j

This is not ORM related so I will move this post to a more appropriate forum.


[How To Ask Questions][Read before you PM me]
 
 
subject: Exception in thread "main" java.lang.NoClassDefFoundError: org/slf4j/impl/StaticLoggerBinder
 
Similar Threads
Problem in building hibernate SessionFactory
Problem configuring Hibernate and JPA in Eclipse
what jars are needed for jpa using hibernate
Hibernate configuration problem
Null pointer exception in HQL using parameter