-->
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.  [ 1 post ] 
Author Message
 Post subject: Can't get basic demo app to work
PostPosted: Tue Sep 14, 2004 11:03 am 
Newbie

Joined: Tue Sep 14, 2004 10:51 am
Posts: 1
I have been expermenting with Hibernate, and found that when trying to run app getting a NoClassDefFoundError. Now I know that this may seem like a typical classpath issue, but please read on!

I have un-jar'd the Hibernate2.jar (which is in the ext directory under JRE install) and found that the Class net.sf.hibernate.cfg.Configuration is there.

(By the way this is the class that it recons it can't find!!!)



Hibernate version: 2.0.3

The code that I am using was taken from the ONJava tut:

// 2. Fire up Hibernate
Configuration cfg = new onfiguration().addClass(Product.class);
SessionFactory sf = cfg.buildSessionFactory();

System.out.println(p);
// 3. Open Session
Session sess = sf.openSession();

// 4. Save Product and close Session
Transaction t = sess.beginTransaction();
sess.save(p);
t.commit();
sess.close();



Stack Trace:

C:\database\HibernateArticle\src>java test.InsertProduct Milk 100 1.99
Exception in thread "main" java.lang.NoClassDefFoundError: net/sf/hibernate/cfg/
Configuration
at test.InsertProduct.main(InsertProduct.java:23)


Database: hsqldb (latest stable build)

Any help would be greatly appreciated! if there is anything I missed just let me know.


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

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.