Win a copy of Java Mock Exams (software) this week in the Programmer Certification (OCPJP) forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

No Persistence provider for EntityManager

 
ArunKumar Kandregula
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Ulf Dittmer
Rancher
Posts: 42970
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
There's a typo in the <provider> element.
 
ArunKumar Kandregula
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello Ulf. You really saved my day. I corrected the typo and it started working as expected.

Thank you so much Ulf .
 
Happiness is not a goal ... it's a by-product of a life well lived - Eleanor Roosevelt. Tiny ad:
the new thread boost feature: great for the advertiser and smooth for the coderanch user
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!