Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

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

 
Luke Murphy
Ranch Hand
Posts: 300
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 300
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 2700
IntelliJ IDE Opera
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You do understand that javax.persistence aka JPA is a specification and that eclipselink is an implementation of that specification?
 
Luke Murphy
Ranch Hand
Posts: 300
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic