Need help with Hibernate? Read this first:
http://www.hibernate.org/ForumMailingli ... AskForHelp
Hibernate version:
EntityManager 3.2.0GA
Mapping documents:
Code between sessionFactory.openSession() and session.close():
Full stack trace of any exception that occurs:
Exception thrown : javax.persistence.PersistenceException: No Persistence provider for EntityManager named healthClubMembers
at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:55)
at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:33)
at org.myhealthclub.transaction.utility.EntityManagerUtility.getEntityManager(EntityManagerUtility.java:19)
Name and version of the database you are using:
The generated SQL (show_sql=true):
Debug level Hibernate log excerpt:
Problems with Session and transaction handling?
Read this:
http://hibernate.org/42.html
My problem is this. I have a proper J2EE Application structure /project (Using Eclipse WTP 1.5). Where I have an EAR Project a Web Project and a "utility" Java Project. I do all the "JPA stuff" in the Java Project. When the web project invokes logic from the Java Project, based on the exception I am getting I believe the persistence.xml is not being found. Yet if I put all the code in the Web Project things work fine.
The reason I want to separate and put all the JPA stuff in a separate Java project, is because it is "utility" code, that I want to use across multiple other J2EE modules, Web, EJB, etc. I don't want all this logic collapsed into a single Web Module. However, unless I do so, it seems that the classloaders, or whatever can't find the persistence.xml.
Any ideas, is this a known bug. By the way out of interest, this same behaviour/problem exists with the Toplink JPA reference implementation as well (although the exception is different).