Spring 4 + Hibernate 5 = org.springframework.orm.jpa.EntityManagerHolder cannot be cast to org.springframework.orm.hibernate5.SessionHolder

Do you use Spring-Boot? Is so, in my case the problem was with @EnableAutoConfiguration – use exclude=HibernateJpaAutoConfiguration.class

Leave a Comment