• 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 all forums
this forum made possible by our volunteer staff, including ...
  • Campbell Ritchie
  • Liutauras Vilda
  • Bear Bibeault
  • Jeanne Boyarsky
  • Tim Cooke
  • Knute Snortum
  • Junilu Lacar
  • Devaka Cooray
Saloon Keepers:
  • Ganesh Patekar
  • Tim Moores
  • Carey Brown
  • Stephan van Hulst
  • salvin francis
  • Ron McLeod
  • Frits Walraven
  • Pete Letkeman

Getting ClassDefNotFound Exception while using Hibernate3.jar  RSS feed

Posts: 3
  • Mark post as helpful
  • send pies
  • 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
  • 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.

With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!