读书人

JPA与Spring2.5整合时发生不能创建ent

发布时间: 2013-09-11 17:27:29 作者: rapoo

JPA与Spring2.5整合时发生不能创建entityManagerFactory的问题解决方法
今天在做jpa与spring整合时,发现个异常... 如下

异常内容: 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



解决方法: 在persisitence.xml文件中添加 <provider>org.hibernate.ejb.HibernatePersistence</provider>



次要解决方法:在你的spring配置文件中: Container去掉试试,GOOK LUCK!



<bean id="entityManagerFactory"
value="ssj" />
</bean>


我的异常网推荐解决方案:org.springframework.beans.factory.BeanCreationException:,http://www.myexception.cn/j2ee/10759.html

读书人网 >软件架构设计

热点推荐