File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Object Relational Mapping and the fly likes No Persistence provider for EntityManager Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » Object Relational Mapping
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: 41817
    
  62
There's a typo in the <provider> element.


Ping & DNS - my free Android networking tools app
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