spring集合JPA报错Cannot find class [org.hibernate.ejb.HibernatePersistence]

1、Cannot find class [org.hibernate.ejb.HibernatePersistence]

严重: Exception sending context initialized event to listener instance of class org.springframework.web.context.ContextLoaderListener

org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'entityManagerFactory' defined in ServletContext resource [/WEB-INF/application-beans.xml]: Invocation of init method failed; nested exception is java.lang.IllegalArgumentException: Cannot find class [org.hibernate.ejb.HibernatePersistence]

问题:
jar包版本错误hibernate-entitymanager的版本问题,5.0以后的版本没有org.hibernate.ejb.HibernatePersistence这个类,所以改成4.1.7版本就行

spring集合JPA报错Cannot find class [org.hibernate.ejb.HibernatePersistence]_第1张图片

你可能感兴趣的:(异常)