在 WebSphere Community Edition 2.1 上运行的 Spring 3 MVC 项目中,我正在尝试配置我的 entityManagerFactory。但是,我似乎无法覆盖 PersistanceProvider。它默认为 OpenJPA,甚至将其排除为隐藏类:
<sys:hidden-classes>
<sys:filter>org.apache.openjpa</sys:filter>
</sys:hidden-classes>
但是,在尝试部署应用程序时,我在 WebSphere 中收到以下错误:
javax.persistence.PersistenceException: Invalid or inaccessible provider class: org.apache.openjpa.persistence.PersistenceProviderImpl
即使我在persistance.xml 中提供了不同的提供者(HibernatePersistence):
<persistence-unit name="com.intl.cigna">
<description>
Persistence unit for the JPA implementation
</description>
<provider>org.hibernate.ejb.HibernatePersistence</provider>
<non-jta-data-source>java:comp/env/jdbc/myJndiDS</non-jta-data-source>
<properties>
<property name="hibernate.dialect" value="org.hibernate.dialect.SQLServer2008Dialect"/>
<property name="hibernate.show_sql" value="true" />
</properties>
</persistence-unit>