Hi,
I am a newbie to Hibernate and I am trying to run the Event example described in the tutorial (
http://www.hibernate.org/hib_docs/v3/re ... orial.html).
When I run my project, I get the following error message:
Code:
SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.
Initial SessionFactory creation failed.java.lang.NoClassDefFoundError: org/slf4j/impl/StaticLoggerBinder
Exception in thread "main" java.lang.ExceptionInInitializerError
at util.HibernateUtil.<clinit>(HibernateUtil.java:17)
at org.hibernate.tutorial.domain.EventManager.createAndStoreEvent(EventManager.java:23)
at org.hibernate.tutorial.domain.EventManager.main(EventManager.java:15)
Caused by: java.lang.NoClassDefFoundError: org/slf4j/impl/StaticLoggerBinder
at org.slf4j.LoggerFactory.<clinit>(LoggerFactory.java:60)
at org.hibernate.cfg.Configuration.<clinit>(Configuration.java:151)
at util.HibernateUtil.<clinit>(HibernateUtil.java:13)
... 2 more
When I take a look at
http://www.slf4j.org/codes.html#StaticLoggerBinder, it says:
Quote:
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.
I have checked my libraries and I have slf4j-api-1.5.2.jar included my project. I have checked the content of the hibernate-distribution-3.3.1.GA I have downloaded and unzipped, but I cannot find any of the .jars mentioned above.
Does anyone know the solution to this problem?
Thanks,
J.
Hibernate version:
3.3.1
Mapping documents:
<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC
"-//Hibernate/Hibernate Mapping DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
<hibernate-mapping>
<class name="events.Event" table="EVENTS">
<id name="id" column="EVENT_ID">
<generator class="native"/>
</id>
<property name="date" type="timestamp" column="EVENT_DATE"/>
<property name="title"/>
</class>
</hibernate-mapping>
Code between sessionFactory.openSession() and session.close():
session.beginTransaction();
Event theEvent = new Event();
theEvent.setTitle(title);
theEvent.setDate(theDate);
session.save(theEvent);
session.getTransaction().commit();
Full stack trace of any exception that occurs:
See above
Name and version of the database you are using:
hsqldb, version 1.8.0.10
The generated SQL (show_sql=true):
N.A.
Debug level Hibernate log excerpt:
N.A.