Play 2.4.0, how to fix "HHH015016: Encountered a deprecated javax.persistence.spi.PersistenceProvider [org.hibernate.ejb.HibernatePersistence]; use [org.hibernate.jpa.HibernatePersistenceProvider] instead."

1,037 views
Skip to first unread message

Daniel Lindberg

unread,
Jun 2, 2015, 10:37:16 AM6/2/15
to play-fr...@googlegroups.com
I'm using play 2.4.0 with JPA and the Hibernate implementation. 

Seeing this message in the log:
[warn] o.h.e.HibernatePersistence - HHH015016: Encountered a deprecated javax.persistence.spi.PersistenceProvider [org.hibernate.ejb.HibernatePersistence]; use [org.hibernate.jpa.HibernatePersistenceProvider] instead.




My persistence.xml is a copy paste from the Play documentation:
<persistence xmlns="http://xmlns.jcp.org/xml/ns/persistence"
             
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
             
xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/persistence http://xmlns.jcp.org/xml/ns/persistence/persistence_2_1.xsd"
             
version="2.1">


   
<persistence-unit name="defaultPersistenceUnit" transaction-type="RESOURCE_LOCAL">
       
<provider>org.hibernate.jpa.HibernatePersistenceProvider</provider>
       
<non-jta-data-source>DefaultDS</non-jta-data-source>
       
<properties>
           
<property name="hibernate.dialect" value="org.hibernate.dialect.H2Dialect"/>
       
</properties>
   
</persistence-unit>


</persistence>

In build.sbt I'm importing javaJpa and Hibernate 4.3.10.Final. 

libraryDependencies ++= Seq(
  javaJpa
,
 
"org.hibernate" % "hibernate-entitymanager" % "4.3.10.Final",
 
...
)

Any idea where this might be coming from and how to fix?

Matthias Kurz

unread,
Jun 2, 2015, 10:53:07 AM6/2/15
to play-fr...@googlegroups.com
This has nothing to do with Play.

This is a bug in Hibernate, which will be fixed in upcoming Hibernate 5, see https://hibernate.atlassian.net/browse/HHH-9141
Actually printing the warning message itself is the bug, nothing else. You don't have to change anything in your code, just ignore this warning for now.

Regards,
Matthias
Reply all
Reply to author
Forward
0 new messages