I have the following persistence.xml and profile-db.xml. Getting an error while reading the profile-db.xml. Is some thing wrong or am i missing some of the basics. You help is really appreciated...
Persistence.xml:
<?xml version="1.0" encoding="UTF-8"?>
<persistence version="1.0" xsi:schemaLocation="http://java.sun.com/xml/ns/persistence
http://java.sun.com/xml/ns/persistence/ ... ce_1_0.xsd"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://java.sun.com/xml/ns/persistence">
<persistence-unit name="dBManager11" transaction-type="RESOURCE_LOCAL">
<provider>org.hibernate.ejb.HibernatePersistence</provider>
<jta-data-source>java:/dataSource-LAB</jta-data-source>
<mapping-file>profile-db.xml</mapping-file>
</persistence-unit>
</persistence>
profile-db.xml:
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/b ... -beans.xsd">
<bean id="dataSource-LAB" destroy-method="close"
class="org.apache.commons.dbcp.BasicDataSource">
<property name="hibernate.connection.driver_class" value="oracle.jdbc.driver.OracleDriver" />
<property name="hibernate.dialect" value="org.hibernate.dialect.OracleDialect" />
<property name="hibernate.connection.url"
value="..." />
<property name="hibernate.show_sql" value="true" />
<property name="hibernate.connection.username" value="..." />
<property name="hibernate.connection.password" value="..." />
<property name="initialSize" value="1" />
<property name="maxActive" value="20" />
<property name="maxWait" value="300000" />
<property name="testOnBorrow" value="false" />
<property name="testOnReturn" value="false" />
<property name="testWhileIdle" value="true" />
<property name="timeBetweenEvictionRunsMillis" value="30000" />
<property name="validationQuery" value="SELECT sysdate from dual" />
</bean>
<bean id="entityManagerFactory"
class="org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean">
<property name="dataSource" ref="dataSource-LAB"/>
<property name="persistenceUnitName" value="dBManager11" />
<property name="jpaVendorAdapter">
<bean class="org.springframework.orm.jpa.vendor.HibernateJpaVendorAdapter">
</bean>
</property>
</bean>
<bean id="transactionManager" class="org.springframework.orm.jpa.JpaTransactionManager">
<property name="entityManagerFactory" ref="entityManagerFactory"/>
</bean>
</beans>
Exception:
Caused by: javax.persistence.PersistenceException: [PersistenceUnit: dBManager11] Error while reading JPA XML file: profile-db.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.att.scld.grm.userprofiledao.utils.GRMUtils.<clinit>(GRMUtils.java:32)
... 40 more
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)
... 47 more
Caused by: org.dom4j.DocumentException: null Nested exception: null
at org.dom4j.io.SAXReader.read(SAXReader.java:484)
at org.hibernate.util.xml.MappingReader.readMappingDocument(MappingReader.java:75)
... 53 more