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?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

fargoCommented:
dom4j.jar is missing in WEB-INF/lib folder
fargoCommented:

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
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.
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
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
JSP

From novice to tech pro — start learning today.