java.lang.ClassNotFoundException: org.hibernate.HibernateException

Explanation:

  • A ClassDefNotFound exception means that your program was unable to
    find a required .class file from the referenced libraries.

  • In your case the hibernateX.jar file isn’t packaged inside your
    war file.

  • What you need to do is to add it to the WEB-INF/lib folder of your
    war file.

Solution (using IntelliJ):

  1. open up project structure

  2. select Artifacts from the left side options

  3. from your war file in the OutputLayout tab browse to WEB-INF/lib

  4. add the library containing hibernateX.jar into the folder

  5. redeploy your project.

Solution (using Eclipse):

  1. Simply drag and drop the jar to WEB-INF/lib

Leave a Comment