Skip to content
Advertisement

Cannot instantiate Session Factory in Spring Boot Application

Whenever I run Spring boot app, I got following errors about EntityManagerFactory and SessionFactory which results in Spring error with current stack trace below:

JavaScript

Classes:

Main:

JavaScript

Configuration class:

JavaScript

How can I fix that? What is the problem with creating the beans? I cannot find any information about this problem

Dependencies for Hibernate and Spring are below:
Hibernate -> 5.4.1.Final
Spring -> 2.2.1 Release
My pom.xml file for dependencies:

JavaScript

Advertisement

Answer

Remove hibernate-core dependency and add spring-data-jpa which already includes it.

User contributions licensed under: CC BY-SA
2 People found this is helpful
Advertisement