• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Problem in running Hibernate example

 
abhi singhal
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi ,

On running the example given on hibernate web site, http://www.hibernate.org/hib_docs/v3/reference/en/html/tutorial.html.

I am getting the below menioned error, please confirm how should i proceed further.

run:
[java] Initial SessionFactory creation failed.java.lang.NoClassDefFoundErro
r: org/dom4j/DocumentException
[java] java.lang.ExceptionInInitializerError
[java] at util.HibernateUtil.<clinit>(Unknown Source)
[java] at events.EventManager.createAndStoreEvent(EventManager.java:22)

[java] at events.EventManager.main(EventManager.java:14)
[java] Caused by: java.lang.NoClassDefFoundError: org/dom4j/DocumentExcepti
on
[java] ... 3 more
[java] Exception in thread "main"
[java] Java Result: 1

BUILD SUCCESSFUL
Total time: 1 second




Regards,
Abhinav
 
Arun Kumarr
Ranch Hand
Posts: 661
Eclipse IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please add all necessary jars, especially dom4j.jar
 
dave taubler
Ranch Hand
Posts: 132
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I had just this problem earlier today as well. Your Hibernate distribution should have a lib/ directory containing required JARs. To my knowledge, here are those that are required:

ant-antlr-1.6.5.jar
asm.jar
asm-attrs.jar
cgilib-2.1.3.jar
commons-collections-2.1.1.jar
commons-logging-1.0.4.jar
dom4j-1.6.1.jar
jta.jar
log4j-1.2.11.jar

Obviously some of the version numbers may differ. And some of those may actually be optional. I just got the list from an online tutorial, and after I copied all of those into my application's lib/ directory and added them to the classpath, all was well.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic