Archive

Posts Tagged ‘Hibernate’

Unavoidable deprecation warning in Hibernate 4.3

If you are using Hibernate 4.3 with JPA you may have seen the following warning:

WARN org.hibernate.ejb.HibernatePersistence HHH015016: Encountered a deprecated javax.persistence.spi.PersistenceProvider [org.hibernate.ejb.HibernatePersistence]; use [org.hibernate.jpa.HibernatePersistenceProvider] instead.

Fair enough, unfortunately it is difficult to get rid of it. Our persistence.xml already used the new provider:


<persistence-unit name="PU" transaction-type="RESOURCE_LOCAL">
  <provider>org.hibernate.jpa.HibernatePersistenceProvider</provider>
  ...
</persistence-unit>

What to do? It appears that this is a known bug, but as of 4.3.6.Final it is still open.

A convoluted workaround is to use custom code in order to create the correct persistence provider, as described here. Personally I prefer to wait for the fix as long as there are no test failures or other issues.

Categories: Java