我正在尝试创建一个自定义持久性提供程序类而不是openjpa.PersistenceProviderImpl
. 因此,我MyProvider
在persistence.xml
.
但它给出了一个警告日志
INFO: Found persistence provider "org.juddi.test.persistance.JUDDIPersistenceProviderImpl". OpenJPA will not be used.
我查看了openjpa
代码。#isOpenJPAPersistenceProvider()
它在评估MyProvider
为未知提供者的方法上失败。为了验证这一点,我只是复制粘贴了整个课程内容org.apache.juddi.persistence.PersistenceProviderImpl
并进行了检查。
public class MyProviderImpl implements PersistenceProvider, ProviderUtil
它没有Persistence.createEntityManagerFactory(persistenceUnitName);
说
javax.persistence.PersistenceException: No persistence providers available for "juddiDatabase" after trying the following discovered implementations: org.apache.openjpa.osgi.OSGiPersistenceProviderImpl
有没有人尝试在OpenJPA中使用自定义提供程序?