2

I am new to Spring and Hibernate. When I run my project, I'm getting below exceptions. Please help me to resolve this.

Error creating bean with name 'sessionFactory' defined in ServletContext resource [/WEB-INF/applicationContext.xml]: Invocation of init method failed; nested exception is java.lang.NoClassDefFoundError: org/hibernate/annotations/common/reflection/ClassLoaderDelegate


enter image description here

2
  • Please take a look at the comments - stackoverflow.com/questions/33000878/… Commented Apr 13, 2016 at 6:29
  • You need to add a full stack trace, Hibernate version, a list of your libraries or pom.xml. Commented Apr 13, 2016 at 6:38

1 Answer 1

4

A problem is, obviously, with your mess of libraries.

You use Hibernate 5 so you need hibernate-commons-annotations-5.0.1.Final.jar. The class ClassLoaderDelegate resides in this jar.

You don't need hibernate-commons-annotations-4.0.5.Final.jar,hibernate-annotations-3.5.6-Final.jar (it is for an old version of Hibernate), javaee-api-7.0.jar (hibernate-jpa-2.1-api-1.0.0.Final.jar is similar). Check other jars too. Or the best way to use Maven or Gradle, or download all dependencies for Hibernate 5

Hibernate ORM Releases

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.