wood burning stoves 2.0*
The moose likes Object Relational Mapping and the fly likes Configuration : ClassNotFound Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Databases » Object Relational Mapping
Bookmark "Configuration : ClassNotFound" Watch "Configuration : ClassNotFound" New topic
Author

Configuration : ClassNotFound

Ashish Malik
Ranch Hand

Joined: Jul 11, 2010
Posts: 50
I am writing my first Hibernate application but getting this weird runtime NoClassDefFoundError, inspite Eclipse in showing no error during build.
Error comes at where i have declared a 'Configuration' object.

Waswani Naresh
Ranch Hand

Joined: May 01, 2008
Posts: 66
Hi Ashish,

Could you please provide the list of jars you have in your class path and also the full stack trace that you are getting ?

Reason for getting NoClassDefFoundError could be --> Some internal jar which is referred by Hibernate at runtime is missing.

Regards,
Naresh Waswani


Naresh Waswani
Ashish Malik
Ranch Hand

Joined: Jul 11, 2010
Posts: 50
Here is the stacktrace:

Exception in thread "main" java.lang.NoClassDefFoundError: org/dom4j/DocumentException
at def.Main.main(Main.java:26)
Caused by: java.lang.ClassNotFoundException: org.dom4j.DocumentException
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
... 1 more



My included jars are:
hibernate3.jar
lib/required/*
mysql-connectorj-bin.jar.
Waswani Naresh
Ranch Hand

Joined: May 01, 2008
Posts: 66
Please include dom4j jar in the classpath.

Regards,
Naresh Waswani
 
jQuery in Action, 2nd edition
 
subject: Configuration : ClassNotFound
 
Similar Threads
hbm file version working but annotation not
Beginner in hibernate getting error : org.hibernate.MappingException: Unknown entity
update doesnt work in 1 transaction!
Problem with session
Hibernate optimistic-lock="true" not working