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):
-
open up project structure
-
select Artifacts from the left side options
-
from your war file in the OutputLayout tab browse to
WEB-INF/lib
-
add the library containing hibernateX.jar into the folder
-
redeploy your project.
Solution (using Eclipse):
- Simply drag and drop the jar to
WEB-INF/lib