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
Register / Login
JavaRanch » Java Forums » Databases » Object Relational Mapping
Reply 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: 299
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: 299
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: 299
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://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
 
subject: Please tell me I have a typo in my Persistence.xml
 
Similar Threads
Error using Resource Local Entity Manager
EJB3 2 client apps and 2 different databases
no error but entity is not persisted
Caching with Spring + Hibernate JPA + JBoss Cache
JPA - problem with persistence.xml