The build of my maven project is a war which contains spring-data-commons-1.13.4.RELEASE.jar, hibernate-jpa-2.1-api-1.0.0.Final.jar, hibernate-entitymanager-5.0.12.Final.jar etc.
I have configured the datasource in the tomee.xml and the relevant snippet of persistence.xml is given below:
<persistence-unit name="PU_JTA" transaction-type="RESOURCE_LOCAL">
<provider>org.hibernate.ejb.HibernatePersistence</provider>
<jta-data-source>java:/comp/env/jdbc/myDS</jta-data-source>
<mapping-file>META-INF/orm.xml</mapping-file>
<properties>
...
<property name="hibernate.dialect" value="org.hibernate.dialect.Oracle12cDialect" />
By default Tomee, is using in built EclipseLink and throwing the following:
[EclipseLink-25008] (Eclipse Persistence Services - 2.6.3.v20160428-59c81c5): org.eclipse.persistence.exceptions.XMLMarshalException
Exception Description: A descriptor with default root element {http://java.sun.com/xml/ns/persistence/orm}entity-mappings was not found in the project
and when I removed the eclipselink-2.6.3.jar from tomee/libs,
[localhost-startStop-1] org.apache.openejb.assembler.classic.ReloadableEntityManagerFactory.createDelegate PersistenceUnit(name=merchantEdgePU_JTA, provider=org.eclipse.persistence.jpa.PersistenceProvider) - provider time 1ms
09-Oct-2017 18:19:10.027 SEVERE [localhost-startStop-1] org.apache.tomee.catalina.TomcatWebAppBuilder.startInternal Error merging Java EE JNDI entries in to war /merchantEdgeREST: Exception: java.lang.ClassNotFoundException: org.eclipse.persistence.jpa.PersistenceProvider
org.apache.openejb.OpenEJBRuntimeException: java.lang.ClassNotFoundException: org.eclipse.persistence.jpa.PersistenceProvider
Most of the references like this OR this are suggesting to "Load all Hibernate jars and dependencies ... in tomee/libs folder".
Is it possible to use the hibernate & spring (jpa) jars from the war I have deployed to apache-tomee-plume-7.0.3 overriding the default configuration?