Home > Java > Unavoidable deprecation warning in Hibernate 4.3

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">

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
  1. 2014-08-20 at 12:48

    Reblogged this on Dinesh Ram Kali..

  2. 2015-07-21 at 06:26

    Una solucion seria copiar los archivos jar de la libreria del Hibernate JPA2.0 del Netbeans 7.4

  3. 2015-07-21 at 08:26

    Mixing jars from different Hibernate versions sounds quite dangerous and if you are copying from the same version you will get the same file. However, the bug has now been fixed as of Hibernate 5.0.0.Beta1.

  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: