现在的位置: 首页 > 综合 > 正文

JPA与Spring2.5整合出现的问题

2013年12月04日 ⁄ 综合 ⁄ 共 461字 ⁄ 字号 评论关闭

在做单元测试的始终是报如下异常:

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>

抱歉!评论已关闭.