Persistence Websphere JPA incompatible with default PersistenceProvider

I get the following error

  [9/29/15 21:06:33:816 IST] 0000003f JPAPUnitInfo  E   CWWJP0015E: An error  occurred in the 
org.hibernate.ejb.HibernatePersistence persistence provider when it attempted  to create the
container entity manager factory for the rga-hibernate-jpa persistence unit. 
The following error occurred: 
java.lang.ClassCastException: org.hibernate.ejb.HibernatePersistence 
incompatible with javax.persistence.spi.PersistenceProvider.

This problem has been experienced by many people. 1. this , 2. this , 3. and this

I looked at the answers given in the links above and in some other forums. The general suggestion is to remove the JPA 2.0 jar (which I cannot do) and make the classloader as the parent.

Is there any other solution besides this? Like defining some properties in my persistence.xml.

My version of websphere is 8.5.5.2.

In my persistence.xml    
<provider>org.hibernate.ejb.HibernatePersistence</provider>

==================== UPDATE ========================

My dependencies: My addiction

+4
source share
1 answer

, , , javax.persistence API. , ( Hibernate impl) , WebSphere. WebSphere , jar Hibernate JPA.

, ... , Hibernate JPA . WebSphere v8.5.5.2 JPA 2.0. Hibernate ( EclipseLink OpenJPA), JPA 2.1, . . . , , . , - , , JPA 2.1, , .

+6

Source: https://habr.com/ru/post/1609654/


All Articles