spring2.5与jpa整合问题

来源:互联网 发布:fft蝶形算法 编辑:程序博客网 时间:2024/04/20 05:04
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'entityManagerFactory' defined in class path resource [beans.xml]:: Invocation of init method failed; nested exception is java.lang.IllegalArgumentException: No PersistenceProvider specified in EntityManagerFactory configuration, and chosen PersistenceUnitInfo does not specify a provider class name either
在EntityManagerFactory 的配置中没有明确的持久供应对象

persistence.xml 有问题
可能原因:
1. 配置文件路径问题

<property name="persistenceXmlLocation" value="路径/persistence.xml" /> 确认路径正确

2. 配置文件本身问题

persistence.xml中缺少<provider>org.hibernate.ejb.HibernatePersistence</provider>   

缺少该语句 单一JPA的时候是可以通过的  但是集成spring就会出错

原创粉丝点击