From: <no...@at...> - 2006-06-28 12:15:16
|
Ejb3Configuration should output a warning if no persistence.xml is found ------------------------------------------------------------------------ Key: EJB-201 URL: http://opensource.atlassian.com/projects/hibernate/browse/EJB= -201 Project: Hibernate Entity Manager Type: Improvement Components: EntityManager =20 Versions: 3.2.0.cr1 =20 Environment: Any Environment with missing persistence.xml or bad ClassLoad= ers Reporter: Ren=C3=A9 Treffer If persistence.xml can't be found javax.ejb.Persistence return's "No Persis= tence found for EntityManager <name>". However it might help a lot of people if Ejb3Configuration could output a w= arning in public EntityManagerFactory createEntityManagerFactory(String emName, Map i= ntegration) { The warning might be something like "No META-INF/persistence.xml found". In= my case it looks like a Jetty6 ClassLoader problem, a simple warning might= have saved me hours of bugtracking. A sample Trace: 93676 [btpool0-20] INFO org.hibernate.ejb.Version - Hibernate EntityManag= er 3.2.0.CR1 93712 [btpool0-20] INFO org.hibernate.cfg.annotations.Version - Hibernate= Annotations 3.2.0.CR1 93729 [btpool0-20] INFO org.hibernate.cfg.Environment - Hibernate 3.2 cr2 93736 [btpool0-20] INFO org.hibernate.cfg.Environment - hibernate.propert= ies not found 93739 [btpool0-20] INFO org.hibernate.cfg.Environment - Bytecode provider= name : cglib 93752 [btpool0-20] INFO org.hibernate.cfg.Environment - using JDK 1.4 jav= a.sql.Timestamp handling 93923 [btpool0-20] DEBUG org.hibernate.ejb.Ejb3Configuration - Trying to f= ind persistence unit: losem <<< Here should be a "WARN org.hibernate.ejb.Ejb3Configuration - No META-IN= F/persistence.xml found" followed by=20 java.lang.ExceptionInInitializerError ...... Caused by: javax.persistence.PersistenceException: No Persistence provider = for EntityManager named losem at javax.persistence.Persistence.createEntityManagerFactory(Persist= ence.java:41) at javax.persistence.Persistence.createEntityManagerFactory(Persist= ence.java:27) at de.rtjava.los.pmanager.PersistenceManager.<clinit>(PersistenceMa= nager.java:58) ... 29 more Good luck and a big thank-you fr Hibernate! --=20 This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://opensource.atlassian.com/projects/hibernate/secure/Administrators= .jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira |