Link to home
Start Free TrialLog in
Avatar of Fernando44
Fernando44

asked on

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


SOLUTION
Avatar of fargo
fargo

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Siva Prasanna Kumar
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.
Avatar of Fernando44
Fernando44

ASKER

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:
https://www.experts-exchange.com/questions/21826651/NoClassDefFoundError-in-Tomcat.html

Many thanks

Fernando