Link to JPA project from Eclipse plugin leads to the output "PersistenceException: No Persistence for EntityManager"

I am trying to create an Eclipse application that uses JPA to save.
I am trying to use EclipseLink as my provider (more specifically org.eclipse.persistence.jpa.PersistenceProvider ) and Derby as my database.
I currently have an Eclipse JPA project that deals with all database communications and defines models. This product is subjected to unit testing, and it all works.

The idea is that my Eclipse application uses this project to get the model objects that it uses.
The problem is that as soon as I try to create an EntityManager , I get a " No Persistence provider " exception.

I tried to refer directly to the JPA project or first exported it to the bank and depending on this. Nothing worked.

Now, as far as I can guess, this means that it does not see my persistence.xml or that the save provider is not in my class path.

The save file is located in the META-INF at the root of my can, so I hope it needs to be raised. I also added the following to the MANIFEST.MF 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, I hope, will cause access to the necessary classes.

Can anyone see what I am missing? Is there a way to see which of the two problems could be? Is this one of these problems?

Thanks for any help.

+4
source share
1 answer

Note: the current wiki example is still deprecated (since August 2008 ...)

You can see in your updated example a launcher (with a list of related plugins)

Their MANIFEST.MF looks like this:

 Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: Application Plug-in Bundle-SymbolicName: org.eclipse.persistence.example.jpa.rcp.comics; singleton:=true Bundle-Version: 1.0.0 Require-Bundle: org.eclipse.core.runtime, org.eclipse.ui, org.eclipse.persistence.jpa, system.bundle, org.eclipse.persistence.example.jpa.comics.model.annotated;bundle-version="1.0.0", javax.persistence;bundle-version="1.99.0", org.eclipse.persistence.antlr;bundle-version="0.1.0" Bundle-RequiredExecutionEnvironment: J2SE-1.5 Bundle-ClassPath: . Import-Package: org.apache.derby.jdbc 

Maybe this example can help you find what is wrong in your application?

+3
source

All Articles