NoClassDefFoundError in IDE and Tomcat

Hi

I am getting a runtime exception as follows:


#############  Exception:
--------------------Configuration: peacBudget - JDK version 1.5.0_02 <Default> - <Default>--------------------
java.lang.NoClassDefFoundError: org/dom4j/DocumentException
        at peacBudget.HibernateUtil.<clinit>(HibernateUtil.java:59)
Exception in thread "main"
Process completed.


###################  Extract of class that has the exception:
package peacBudget;

import org.hibernate.*;
import org.hibernate.cfg.*;
import org.hibernate.hql.*;

public class HibernateUtil {

      private HibernateUtil() {

      }

    private static final SessionFactory sessionFactory;
      private static Configuration config = new Configuration().configure();
    ###Exception is thrown at this line.


#################
The class compiles OK but cannot find Configuration class which is in the
hibernate3.jar which is in my class path (or else would not compile)

I am getting the same exception from Tomcat which has the hibernate3.jar in the
C:\Tomcat4\webapps\peacBudget\WEB-INF\lib folder.

Am I regressing and losing basic java here?

Please help

Fernando


Fernando44Asked:
Who is Participating?
 
fargoCommented:
0
 
fargoCommented:
dom4j.jar is missing in WEB-INF/lib folder
0
 
Siva Prasanna KumarPrincipal Solutions ArchitectCommented:
Best is to include all the jars provideed with hibernate to the WEB-INF/lib directory ( i.e which are present in the lib folder of the hibernate)  becuase it keeps on demanding one after the other if you want check it out.

Else atleast make sure you have included all the jars specified in the readme document of hibernate.

Thank You.
0
 
Fernando44Author Commented:
Hi Fargo

It was looking me in the face!

Thanks!

Could you go to the next query as I am getting the NoClassDefFoundError in Tomcat even though the jar files are in the lib folders:
http://www.experts-exchange.com/Web/Web_Languages/JSP/Q_21826651.html

Many thanks

Fernando
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.