aspose file tools*
The moose likes Object Relational Mapping and the fly likes Please tell me I have a typo in my Persistence.xml Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Databases » Object Relational Mapping
Bookmark "Please tell me I have a typo in my Persistence.xml" Watch "Please tell me I have a typo in my Persistence.xml" New topic
Author

Please tell me I have a typo in my Persistence.xml

Luke Murphy
Ranch Hand

Joined: May 12, 2010
Posts: 300
Right I have been banging my head against the wall trying to get a simple EntityManagerFactory created.



To try to get an EntityManagerFactory I do:



My persistence.xml is in a META-INF directory and I have tried both using the project as is in eclipse and packaging it all into a jar.
No matter what I try I get:

javax.persistence.PersistenceException: No Persistence provider for EntityManager named my-app

I have written a simple JDBC program with the same db details and that connects. So nothing wrong with my DB,.
So what's up?

Note: I am using eclipselink

Cheers.
Luke Murphy
Ranch Hand

Joined: May 12, 2010
Posts: 300
Resolved. I only had the javax.persistence_x jar that comes as part of the
eclipselink install. I was missing the eclipselink.jar.

Wouter Oet
Saloon Keeper

Joined: Oct 25, 2008
Posts: 2700

You do understand that javax.persistence aka JPA is a specification and that eclipselink is an implementation of that specification?


"Any fool can write code that a computer can understand. Good programmers write code that humans can understand." --- Martin Fowler
Please correct my English.
Luke Murphy
Ranch Hand

Joined: May 12, 2010
Posts: 300
Wouter Oet wrote:You do understand that javax.persistence aka JPA is a specification and that eclipselink is an implementation of that specification?

Correct. As is hibernate. You need an implementation on your classpath. I was looking for the simpliest in terms of configuration and footprint.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Please tell me I have a typo in my Persistence.xml
 
Similar Threads
no error but entity is not persisted
Error using Resource Local Entity Manager
Caching with Spring + Hibernate JPA + JBoss Cache
EJB3 2 client apps and 2 different databases
JPA - problem with persistence.xml