• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Problem in running Hibernate example

 
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Ranch Hand
Posts: 662
Eclipse IDE Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Please add all necessary jars, especially dom4j.jar
 
Ranch Hand
Posts: 132
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic