• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

No Persistence provider for EntityManager named...

 
Tony Ennis
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?
 
Himanshu Chitranshi
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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic