File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes EJB Certification (SCBCD/OCPJBCD) and the fly likes Problem in Standalone persistence Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Certification » EJB Certification (SCBCD/OCPJBCD)
Bookmark "Problem in Standalone persistence" Watch "Problem in Standalone persistence" New topic

Problem in Standalone persistence

Amirr Rafique
Ranch Hand

Joined: Nov 14, 2005
Posts: 324
Hi ranchers

I am trying to use persistence in a standalone application. My persistence.xml is in META-INF directory of my jar file. This jar file also contain the the standalone application. On trying to run the application I get following exception

Please help


"Know where to find the solution and how to use it - that's the secret of success."
Amirr Rafique
Ranch Hand

Joined: Nov 14, 2005
Posts: 324
Guys any help on this
Jun Liu

Joined: Nov 15, 2005
Posts: 11
The exception said there is no persistence provider for the entity manager. Persistence provider should be defined in persistence.xml as:

Here I am using the EclipseLink as my persistence provider. Please check if your persistence.xml constains <provider> element under <persistence-unit>
Christophe Verré

Joined: Nov 24, 2005
Posts: 14687

Show us your persistence.xml, and tell us how you executed your client.

[My Blog]
All roads lead to JavaRanch
Amirr Rafique
Ranch Hand

Joined: Nov 14, 2005
Posts: 324
Please see below my persistence.xml

I am running my class from jar file and persistence.xml is in META-INF directory of the jar file.

Looking forward for your expert opinion

I agree. Here's the link:
subject: Problem in Standalone persistence