OpenJPA 2.2.0: Cannot add a custom persistence provider class : OpenJPA recognizes it as unknown provider

256 Views Asked by At

I am trying to create a custom persistence provider class instead of openjpa.PersistenceProviderImpl. Hence I added MyProvider class to the persistence.xml.

But it gives a warning log as

INFO: Found persistence provider "org.juddi.test.persistance.JUDDIPersistenceProviderImpl". OpenJPA will not be used. 

I looked in to the openjpa code. It fails at #isOpenJPAPersistenceProvider() method where it evaluates MyProvider as an unknown provider. To verify this, I just copy pasted the whole class content in org.apache.juddi.persistence.PersistenceProviderImpl and checked.

public class MyProviderImpl  implements PersistenceProvider, ProviderUtil

And it fails at Persistence.createEntityManagerFactory(persistenceUnitName); saying

javax.persistence.PersistenceException: No persistence providers available for "juddiDatabase" after trying the following discovered implementations: org.apache.openjpa.osgi.OSGiPersistenceProviderImpl 

Have anyone tried using a custom provider in OpenJPA ?

0

There are 0 best solutions below