quarks
quarks

Reputation: 35282

Initial SessionFactory creation failed.java.lang.NoClassDefFoundError: org/slf4j/LoggerFactory

I'm getting this error:

Initial SessionFactory creation failed.java.lang.NoClassDefFoundError: org/slf4j/LoggerFactory

Is this error is cause by Jar Imports or the database (MySQL table) problem can cause the problem?

How to solve this?

Upvotes: 0

Views: 7156

Answers (2)

Mikko Maunu
Mikko Maunu

Reputation: 42094

Add SLF4J to classpath, recent versions of Hibernate use it for logging. You can get it from here.

Upvotes: 0

ishanbakshi
ishanbakshi

Reputation: 1965

You basically need these 2 dependencies (its better if they have the same version) :

slf4j-api-1.*.*.jar

slf4j-simple-1.*.*.jar

Look at your maven dependencies by using the command mvn dependency:tree

See if these dependencies are being loaded. If only one of them is being loaded add the other dependency with the same version. In my case i added this

<dependency> <groupId>org.slf4j</groupId> <artifactId>slf4j-simple</artifactId> <version>1.5.8</version> </dependency>

I referred from this

Upvotes: 1

Related Questions