Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
  • 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Bear Bibeault
  • Paul Clapham
  • Jeanne Boyarsky
Sheriffs:
  • Junilu Lacar
  • Knute Snortum
  • Henry Wong
Saloon Keepers:
  • Ron McLeod
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Frits Walraven
  • Joe Ess
  • salvin francis

No Persistence provider for EntityManager named...

 
Ranch Hand
Posts: 86
  • Mark post as helpful
  • send pies
  • 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?
 
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • 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...

Regards
Himanshu Chitranshi
 
The moth suit and wings road is much more exciting than taxes. Or this tiny ad:
Java file APIs (DOC, XLS, PDF, and many more)
https://products.aspose.com/total/java
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!