This week's book giveaway is in the General Computing forum.
We're giving away four copies of Arduino in Action and have Martin Evans, Joshua Noble, and Jordan Hochenbaum on-line!
See this thread for details.
The moose likes Object Relational Mapping and the fly likes No Persistence provider for EntityManager Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


JavaRanch » Java Forums » Databases » Object Relational Mapping
Reply Bookmark "No Persistence provider for EntityManager" Watch "No Persistence provider for EntityManager" New topic
Author

No Persistence provider for EntityManager

ArunKumar Kandregula
Greenhorn

Joined: Jun 05, 2009
Posts: 10
I have been wrestling with this error for last few days. Please someone point out where I am going wrong.

I am trying to use JPA with eclipselink. It worked fine. To check the behaviour with JPA with hibernate as persistence provider, I changed the persitence.xml and I am getting the infamous error "No Persistence provider for EntityManager named usinghibernate"

My persistence.xml


Java program:



Here is what I did to get hibernate jars : I included 2 dependencies in maven pom.xml:




In the logs, its clear that it is able to find META-INF/persistence.xml and persistence unit and again it complains that it doesnt find the persistence unit.




WARNING: Arun Could not load profiles : No Persistence provider for EntityManager named usinghibernate


Please tell me where I am missing.
I clearly have META-INF/persistence.xml on CLASSPATH and its loading.
I dont know what else it is expecting.


Thank you, Arun Kumar Kandregula.
SCJP 1.4 98%, SCBCD 1.3 92%
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 35442
    
    9
There's a typo in the <provider> element.


Android appsImageJ pluginsJava web charts
ArunKumar Kandregula
Greenhorn

Joined: Jun 05, 2009
Posts: 10
Hello Ulf. You really saved my day. I corrected the typo and it started working as expected.

Thank you so much Ulf .
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: No Persistence provider for EntityManager
 
Similar Threads
Could not resolve dependencies
Strange problem - works on maven glassfish but not on Tomcat
Spring Major version '3' expected
java.util.MissingResourceException: Can't find bundle for base name in JSF Spring Maven project
JPA: Can't find Persistence Provider