I followed exactly the tutoriel being in the documentation of hibernate (the example with the Events).
And when I want to launch the first method which records a first Event, I have this error which I do not understand:
Code:
run:
[java] Initial SessionFactory creation failed.java.lang.ExceptionInInitiali
zerError
[java] Exception in thread "main" java.lang.ExceptionInInitializerError
[java] at util.HibernateUtil.<clinit>(Unknown Source)
[java] at events.EventManager.createAndStoreEvent(Unknown Source)
[java] at events.EventManager.main(Unknown Source)
[java] Caused by: java.lang.ExceptionInInitializerError
[java] ... 3 more
[java] Caused by: org.apache.commons.logging.LogConfigurationException: org
.apache.commons.logging.LogConfigurationException: No suitable Log constructor [
Ljava.lang.Class;@530daa for org.apache.commons.logging.impl.Log4JLogger (Caused
by java.lang.NoClassDefFoundError: org/apache/log4j/Category) (Caused by org.ap
ache.commons.logging.LogConfigurationException: No suitable Log constructor [Lja
va.lang.Class;@530daa for org.apache.commons.logging.impl.Log4JLogger (Caused by
java.lang.NoClassDefFoundError: org/apache/log4j/Category))
[java] at org.apache.commons.logging.impl.LogFactoryImpl.newInstance(Lo
gFactoryImpl.java:543)
[java] at org.apache.commons.logging.impl.LogFactoryImpl.getInstance(Lo
gFactoryImpl.java:235)
[java] at org.apache.commons.logging.impl.LogFactoryImpl.getInstance(Lo
gFactoryImpl.java:209)
[java] at org.apache.commons.logging.LogFactory.getLog(LogFactory.java:
351)
[java] at org.hibernate.cfg.Configuration.<clinit>(Configuration.java:1
16)
[java] ... 3 more
[java] Caused by: org.apache.commons.logging.LogConfigurationException: No
suitable Log constructor [Ljava.lang.Class;@530daa for org.apache.commons.loggin
g.impl.Log4JLogger (Caused by java.lang.NoClassDefFoundError: org/apache/log4j/C
ategory)
[java] at org.apache.commons.logging.impl.LogFactoryImpl.getLogConstruc
tor(LogFactoryImpl.java:413)
[java] at org.apache.commons.logging.impl.LogFactoryImpl.newInstance(Lo
gFactoryImpl.java:529)
[java] ... 7 more
[java] Caused by: java.lang.NoClassDefFoundError: org/apache/log4j/Category
[java] at java.lang.Class.getDeclaredConstructors0(Native Method)
[java] at java.lang.Class.privateGetDeclaredConstructors(Class.java:232
8)
[java] at java.lang.Class.getConstructor0(Class.java:2640)
[java] at java.lang.Class.getConstructor(Class.java:1629)
[java] at org.apache.commons.logging.impl.LogFactoryImpl.getLogConstruc
tor(LogFactoryImpl.java:410)
[java] ... 8 more
[java] Java Result: 1
I understand nothing there; I think that it is a problem with the library commons-logging but I do not see how finding the solution.
could you help me please?