This content has been marked as final.
Show 3 replies
-
-
2. Re: TestNG with hibernate
christian.bauer Jun 11, 2007 6:22 AM (in response to cormet)Session session = (Session)em.getDelegate();
-
3. Re: TestNG with hibernate
cormet Jun 12, 2007 4:24 AM (in response to cormet)Hi Chris,
Thx for the reply. I tried it but i gives me error. here are my simple code:EntityManagerFactory emf = Persistence.createEntityManagerFactory("mySession"); EntityManager em = emf.createEntityManager(); ManagedHibernateSession session = (ManagedHibernateSession) em.getDelegate();
and here are the error:javax.persistence.PersistenceException: No Persistence provider for EntityManager named mySession at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:55) at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:33) at com.medansoft.controller.GeneralJournalActionTest.createGeneralJournalTest(GeneralJournalActionTest.java:19) ... Removed 21 stack frames =============================================== GeneralJournalAction Tests run: 1, Failures: 1, Skips: 0 =============================================== =============================================== Accounting System Test Suite Total tests run: 1, Failures: 1, Skips: 0 ===============================================
As I named my hibernate session -- mySession in component.xml...
Any help will be appreciated...
Thanks