Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

NoClassDefFoundError:

 
Karthik Vijayarajan
Ranch Hand
Posts: 43
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Mark Spritzler
ranger
Sheriff
Posts: 17278
6
IntelliJ IDE Mac Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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 ]
 
Karthik Vijayarajan
Ranch Hand
Posts: 43
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 17278
6
IntelliJ IDE Mac Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Cool. I am glad that worked. I like it when I get one right every once in a while.

Mark
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic