aspose file tools*
The moose likes Object Relational Mapping and the fly likes NoClassDefFoundError: Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » Object Relational Mapping
Bookmark "NoClassDefFoundError: " Watch "NoClassDefFoundError: " New topic
Author

NoClassDefFoundError:

Karthik Vijayarajan
Ranch Hand

Joined: Mar 13, 2005
Posts: 43
Hi
I am getting this exception when i try to get the sessionFactory from the Configuration object.

"java.lang.NoClassDefFoundError: net/sf/hibernate/cfg/Configuration."

I am using Tomcat 5.0.28 and have placed the hibernate.cfg.xml and the mapping xml under web-inf/classes and the actual class files under web-inf/classes/com/abc/ ..

My classpath includes the hibernate jar files hibernate2.jar and cglib-full-2.0.2.jar along with the other required jar's like servlet-api.jar....

Would be great if someone can help me get thru this.

Thanks
Karthik


Karthik <br />SCJP 1.4 SCWCD 1.4 SCBCD 1.3
Mark Spritzler
ranger
Sheriff

Joined: Feb 05, 2001
Posts: 17260
    
    6

Is the hibernate.jar file in Tomcat's classpath? or is it possible that that jar file is being lodaed by a different classloader within Tomcat?

Mark
[ December 02, 2005: Message edited by: Mark Spritzler ]

Perfect World Programming, LLC - Two Laptop Bag - Tube Organizer
How to Ask Questions the Smart Way FAQ
Karthik Vijayarajan
Ranch Hand

Joined: Mar 13, 2005
Posts: 43
Yeah. You were right Mark.
I just copied the hibernate2.jar into web-inf/lib of my tomcat and included in the classpath and it works fine.
Trying to get thru few more exceptions :-)

Thanks a lot.
Mark Spritzler
ranger
Sheriff

Joined: Feb 05, 2001
Posts: 17260
    
    6

Cool. I am glad that worked. I like it when I get one right every once in a while.

Mark
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: NoClassDefFoundError: