This week's book giveaway is in the Design and Architecture forum.
We're giving away four copies of Communication Patterns: A Guide for Developers and Architects and have Jacqui Read on-line!
See this thread for details.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Devaka Cooray
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • paul wheaton
  • Henry Wong
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Tim Moores
  • Carey Brown
  • Mikalai Zaikin
Bartenders:
  • Lou Hamers
  • Piet Souris
  • Frits Walraven

Getting ClassDefNotFound Exception while using Hibernate3.jar

 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Earlier I was using Hibernate2.jar in my application and everything was find. Then I was asked to use Hibernate3.jar file for my application which is in EJB. I had to change all my hbm files and also hibernate.cfg.xml file which use hibernate3 dtds . Accordingly I have also changed my package sturctures(Hibernate 3 package structure) in the Bean class . Now when I build the application I am getting an error like ' ClassDefNotFound Exception org/hibernate/HibernateException'. If i remove this import statement for HibernateException then the error comes at the next import statement ' ClassDefNotFound Exception org/hibernate/Session'. I have all Hibernate jar files under my classpath. In eclipse it is not showing any error at the import statements for hibernate classes, but the error comes only at the build time(I m using ant build).

Please Help me.

Anil Tota
 
Ranch Hand
Posts: 187
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
It seems that the jars visible to your IDE are different from those visible to ant. I have not used Eclipse in a while, but in IntelliJ I have a separate libraries for the IDE and ant (they are linked, but still removing a jar from one implies having to manually make some related changes to the other). Make sure both the IDE and ant can see the new library of jars containing hibernate3.jar.

Eman
 
That feels good. Thanks. Here's a tiny ad:
We need your help - Coderanch server fundraiser
https://coderanch.com/wiki/782867/Coderanch-server-fundraiser
reply
    Bookmark Topic Watch Topic
  • New Topic