When i configured Hibernate as persitence provider in JPA using IBM RSA, and i try to test entities using JUnit , hibernate complains saying "error in Named queries". When i used Openjpa as persistence provider, i dont see any issues. Below is error log.
javax.persistence.PersistenceException: Provider error. Provider: org.hibernate.ejb.HibernatePersistence at javax.persistence.Persistence.createFactory(Persistence.java:176) at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:112) at mshp.fin.model.jpa.entity.manager.BaseManager.getEntityManager(BaseManager.java:19) at mshp.fin.model.jpa.util.EntityManagerUtil.getEntityManager(EntityManagerUtil.java:90) at mshp.fin.model.jpa.entity.controller.test.InvoiceBilledItemManagerTest.testCreateInvoiceBilledItem(InvoiceBilledItemManagerTest.java:65) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:48) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:37) at at javax.persistence.PersistenceException: Provider error. Provider: org.hibernate.ejb.HibernatePersistence at javax.persistence.Persistence.createFactory(Persistence.java:176) at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:112) at mshp.fin.model.jpa.entity.manager.BaseManager.getEntityManager(BaseManager.java:19) at mshp.fin.model.jpa.util.EntityManagerUtil.getEntityManager(EntityManagerUtil.java:90) at mshp.fin.model.jpa.entity.controller.test.InvoiceBilledItemManagerTest.testCreateInvoiceBilledItem(InvoiceBilledItemManagerTest.java:65)
… …. at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:460) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:673) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:386) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:196) Caused by: javax.persistence.PersistenceException: [PersistenceUnit: testPU] Unable to build EntityManagerFactory at org.hibernate.ejb.Ejb3Configuration.buildEntityManagerFactory(Ejb3Configuration.java:677) at org.hibernate.ejb.HibernatePersistence.createEntityManagerFactory(HibernatePersistence.java:126) at javax.persistence.Persistence.createFactory(Persistence.java:172) ... 23 more Caused by: org.hibernate.HibernateException: Errors in named queries: getInvoiceRefundByPk_invId2, getInvoiceReconItemByPk_invId2, getInvoiceRefund_ATByInvoiceRefund, getInvoiceBilledItemReconByReconInvoiceBilledItem, getInvoicePABilledItemReconByReconInvoicePABilledItem, getInvoicePABilledItem_ATByInvoicePABilledItem, getInvoiceRefundByPk_rfndId2, getInvoiceBilledItemReconByInvoiceBilledItem, getInvoicePABilledItemReconByInvoicePABilledItem, getInvoicePABilledItemByPk_invId2, getInvoicePayment_ATByInvoicePayment, getInvoiceReconItem_ATByInvoiceReconItem, getInvoiceReconItemByReconInvoiceBilledItem, getInvoiceBilledItemByOrigInvoiceReconItem, getInvoicePABilledItemReconByEgrcInvoicePABilledItem at org.hibernate.impl.SessionFactoryImpl.<init>(SessionFactoryImpl.java:397) at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1327) at org.hibernate.cfg.AnnotationConfiguration.buildSessionFactory(AnnotationConfiguration.java:859) at org.hibernate.ejb.Ejb3Configuration.buildEntityManagerFactory(Ejb3Configuration.java:669) ... 25 more
Caused by: javax.persistence.PersistenceException: [PersistenceUnit: testPU] Unable to build EntityManagerFactory at org.hibernate.ejb.Ejb3Configuration.buildEntityManagerFactory(Ejb3Configuration.java:677) at org.hibernate.ejb.HibernatePersistence.createEntityManagerFactory(HibernatePersistence.java:126) at javax.persistence.Persistence.createFactory(Persistence.java:172)
|