As far as I know, changing the location of the persistence.xml file is not possible.
Also take a look at this document: Alternative JPA providers in WebSphere Application Server , it looks like you should use Hibernate as a JPA provider by specifying it in the persistence.xml file and entering the necessary banks in your application.
Make sure your persistence.xml points to Hibernate as a JPA provider:
<persistence> <persistence-unit name="myapp"> <provider>org.hibernate.ejb.HibernatePersistence</provider>
You should also be able to achieve this by creating a shared library and using it to configure WebSphere to use an alternative continuity provider. Here you can find how to do this: Configure the Java Persistence API Provider (JPA)
EDIT Given the information in the comments in this answer, it seems the problem can be solved by adding these properties to persistence.xml , as indicated in this post Problem creating WebSphere EntityManagerFactory :
<property name="hibernate.transaction.manager_lookup_class" value="org.hibernate.transaction.WebSphereExtendedJTATransactionLookup" /> <property name="hibernate.transaction.factory_class" value="org.hibernate.transaction.CMTTransactionFactory" />
The same information is also provided in alternative JPA providers in the WebSphere Application Server document.
source share