I have tried several suggested methods to resolve this java persistence exception but have not been successful yet. Any suggestions or help would be greatly appreciated.
Below are the details
SQLQueries.xml
-----------------------------
<?xml version="1.0" encoding="UTF-8"?>
<entity-mappings
xmlns="http://java.sun.com/xml/ns/persistence"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/persistence
http://java.sun.com/xml/ns/persistence/orm_2_0.xsd "
version="2.0">
<sql-query name="GET_NEXT_NUM_SP" callable="true">
<return alias = "nextNumber" class="com.utility.numbergenerator.da.NumberDAOImpl">
<return-property name="nextSeqNum" column="NEXT_SEQ_NUM" />
</return>
{ ? = call Test_Proc }
</sql-query>
</entity-mappings>
persistence.xml
-----------------------
<?xml version="1.0" encoding="UTF-8"?>
<persistence xmlns="http://java.sun.com/xml/ns/persistence"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/persistence
http://java.sun.com/xml/ns/persistence/persistence_2_0.xsd"
version="2.0">
<persistence-unit name="NG" transaction-type="RESOURCE_LOCAL">
<provider>org.hibernate.ejb.HibernatePersistence</provider>
<mapping-file>META-INF/SQLQueries.xml</mapping-file>
<class> Several related classes </class>
<properties> Followed by properties </properties>
</persistence-unit>
Stack trace of the exception
-- Initializing database connection -- javax.persistence.PersistenceException: [PersistenceUnit: NG] Error while reading JPA XML file: META-INF/SQLQueries.xml at org.hibernate.ejb.Ejb3Configuration.addClassesToSessionFactory(Ejb3Configuration.java:1205) at org.hibernate.ejb.Ejb3Configuration.configure(Ejb3Configuration.java:1004) at org.hibernate.ejb.Ejb3Configuration.configure(Ejb3Configuration.java:282) at org.hibernate.ejb.Ejb3Configuration.configure(Ejb3Configuration.java:366) at org.hibernate.ejb.HibernatePersistence.createEntityManagerFactory(HibernatePersistence.java:56) at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:48) at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:32) at com.go2uti.oneworld.common.hibernate.HibernateUtil.initializeJPA(HibernateUtil.java:68) at com.go2uti.oneworld.common.hibernate.HibernateUtil.(HibernateUtil.java:38) at com.go2uti.oneworld.utility.businessidgenerator.da.EntityManagerFactorySingleton.init(EntityManagerFactorySingleton.java:26) at com.go2uti.oneworld.utility.businessidgenerator.compatibility.AbstractPersistentTest.initializeContext(AbstractPersistentTest.java:38) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:606) at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:45) at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15) at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:42) at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:27) at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:30) at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:263) at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:68) at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:47) at org.junit.runners.ParentRunner$3.run(ParentRunner.java:231) at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:60) at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:229) at org.junit.runners.ParentRunner.access$000(ParentRunner.java:50) at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:222) at org.junit.runners.ParentRunner.run(ParentRunner.java:300) at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:50) at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197) Caused by: org.hibernate.InvalidMappingException: Unable to read XML at org.hibernate.util.xml.MappingReader.readMappingDocument(MappingReader.java:101) at org.hibernate.cfg.Configuration.add(Configuration.java:513) at org.hibernate.cfg.Configuration.add(Configuration.java:509) at org.hibernate.cfg.Configuration.add(Configuration.java:716) at org.hibernate.cfg.Configuration.addResource(Configuration.java:801) at org.hibernate.cfg.AnnotationConfiguration.addResource(AnnotationConfiguration.java:152) at org.hibernate.ejb.Ejb3Configuration.addClassesToSessionFactory(Ejb3Configuration.java:1192) ... 34 more
Please help me resolve this issue.