I'd like to create one Bundle that is able to use Java Persistence. To achieve this, I've created a plugin project within Eclipse. In my project, I've created a persistence.xml file into META-INF. I've aslo added in my MANIFEST.mf (into the depencies) those 3 packages :
Then, in my Activator I use this lines to create an EntityManager :
factory = Persistence.createEntityManagerFactory(PERSISTENCE_UNIT_NAME);
EntityManager em = factory.createEntityManager();
To execute my bundle, I've made a product configuration. When I run my product configuration, I got this error :
javax.persistence.PersistenceException: No Persistence provider for EntityManager named people
I've tried to move the location of my persistence.xml
without success. It seems that any package load the persistence.xml
file. Maybe, I don't import the right packages?
You can download my simple Bundle here : download
Could you help me to find a solution or a clue?
I've solved my problem. I only had to put in the classpath of the manifest this packages : - persistence.jar - eclipselink.jar - mysql-connector.jar
Thanks