I am trying to create an Eclipse application that uses JPA for persistence.
I am trying to use EclipseLink as my provider (more specific org.eclipse.persistence.jpa.PersistenceProvider
) and Derby as my database.
Currently I have an Eclipse JPA Project that deals with all the database communication and defines the model entities. This product is being unit tested and it all works.
The idea is that my Eclipse application uses this project to get the model entities that it uses.
The problem is that as soon as I try to create an EntityManager
, I get a "No Persistence provider
" exception.
I have tried referencing the JPA project directly, or first exporting it to a jar and depending on that. Neither worked.
Now as far as I can guess, this either means that it does not see my persistence.xml or that the persistence provider is not in my classpath.
The persistence file is in the META-INF
directory in the root of my jar, so hopefully it should be picked up. I have also added the following to the MANIFEST.MF
of the application plugin:
javax.persistence;bundle-version="1.99.0",
org.eclipse.persistence.antlr;bundle-version="1.1.2",
org.eclipse.persistence.asm;bundle-version="1.1.2",
org.eclipse.persistence.core;bundle-version="1.1.2",
org.eclipse.persistence.jpa;bundle-version="1.1.2"
This would hopefully cause the needed classes to be available.
Can anyone see what I am missing? Is there a way to see which of the two problems it might be? Is it one of these problems?
Thanks for any help.