-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 posts ] 
Author Message
 Post subject: class Not found Exception:org/dom4j/DocumentException
PostPosted: Wed Jul 25, 2007 1:39 am 
Beginner
Beginner

Joined: Wed Jul 18, 2007 7:38 am
Posts: 23
Need help with Hibernate? Read this first:
http://www.hibernate.org/ForumMailingli ... AskForHelp

when i try to execute hibernate program i am getting this problem:

Example code:

package hibernate.examples;

//Hibernate Imports
import org.hibernate.Session;
import org.hibernate.SessionFactory;
import org.hibernate.cfg.Configuration;


public class IdIncrementExample {
public static void main(String[] args) {
Session session = null;

try{
// This step will read hibernate.cfg.xml and prepare hibernate for use
SessionFactory sessionFactory = new Configuration().configure().buildSessionFactory();
session =sessionFactory.openSession();

org.hibernate.Transaction tx = session.beginTransaction();

//Create new instance of Contact and set values in it by reading them from form object
System.out.println("Inserting Book object into database..");
Book book = new Book();
book.setStrBookName("Hibernate Tutorial");
session.save(book);
System.out.println("Book object persisted to the database.");
tx.commit();
session.flush();
session.close();
}catch(Exception e){
System.out.println(e.getMessage());
}finally{
}

}
}

Exception:

Exception in thread "main" java.lang.NoClassDefFoundError: org/dom4j/DocumentException
at hibernate.examples.IdIncrementExample.main(IdIncrementExample.java:16)


Top
 Profile  
 
 Post subject:
PostPosted: Wed Jul 25, 2007 1:59 am 
Beginner
Beginner

Joined: Sun Aug 13, 2006 8:48 am
Posts: 23
the dom4j.jar is not in your classpath


Top
 Profile  
 
 Post subject:
PostPosted: Wed Jul 25, 2007 4:52 am 
Beginner
Beginner

Joined: Wed Jul 18, 2007 7:38 am
Posts: 23
rainytooo wrote:
the dom4j.jar is not in your classpath

Thanks for reply
In my lib folder dom4j-1.5.2.jar file is present


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.