EclipseLink : No Persistence provider for EntityManager named

user376112 picture user376112 · Jul 12, 2010 · Viewed 39.4k times · Source

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 :

  1. javax.persistence.jar
  2. org.eclipse.persistence.jar
  3. org.eclipse.persistence.jar

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?

Answer

user376112 picture user376112 · Jul 14, 2010

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