Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Configuration : ClassNotFound

 
Ashish Malik
Ranch Hand
Posts: 50
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 66
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Ashish Malik
Ranch Hand
Posts: 50
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 66
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please include dom4j jar in the classpath.

Regards,
Naresh Waswani
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic