Win a copy of Escape Velocity: Better Metrics for Agile Teams this week in the Agile and Other Processes forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
  • Campbell Ritchie
  • Liutauras Vilda
  • Tim Cooke
  • Paul Clapham
  • Jeanne Boyarsky
  • Ron McLeod
  • Frank Carver
  • Junilu Lacar
Saloon Keepers:
  • Stephan van Hulst
  • Tim Moores
  • Tim Holloway
  • Al Hobbs
  • Carey Brown
  • Piet Souris
  • Frits Walraven
  • fred rosenberger

No Persistence provider for EntityManager named...

Ranch Hand
Posts: 86
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I don't know if this is the right forum. We're using Hibernate and this seems related to its configuration.

I'm getting the following:
javax.persistence.PersistenceException: No Persistence provider for EntityManager named xyzzy

My code looks like this:

My persistence.xml file includes this:

My application is a web service. The code works from my IDE (which doesn't use the persistence.xml file at all, but instead seems to use a datasource configuration of some sort) but fails once it is deployed.

It looks like persistence.xml is supposed to be in the web service's META-INF directory. But I get the error above. I've also added it to the root, to WEB-INF, and even to /lib just to see if something will happen. The error message never changes.

I'd be cool with an error related to configuration as at least that would represent some progress!

Does anyone have any insight into where the persistence.xml file should be, or additional things necessary to make a web service use it?
Posts: 6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
your persistence.xml file should be inside the META-INF directory which is present inside a jar file...

Now you can place this jar file in following locations....

1. WEB-INF/lib directory...
2. root of .ear file
3. root of ejb-jar file ... - preferable

Please let me know where you have placed your jar file...

Himanshu Chitranshi
There's a way to do it better - find it. -Edison. A better tiny ad:
Garden Master Course kickstarter
    Bookmark Topic Watch Topic
  • New Topic