Remove deprecated PersistenceProvider from hibernate-entitymanager META-INF/services/javax.persistence.spi.PersistenceProvider

Description

I'm using hibernate 4.3.5.Final (using maven dependencies, and using Tomcat 7.0.47).

Like I'm using the correct provider in my META-INF/persistence.xml :

1 2 3 <persistence-unit name="com.iorga.irajblank" transaction-type="RESOURCE_LOCAL"> <provider>org.hibernate.jpa.HibernatePersistenceProvider</provider> ...

But I'm getting

1 2 avr. 24, 2014 5:01:24 PM org.hibernate.ejb.HibernatePersistence logDeprecation WARN: HHH015016: Encountered a deprecated javax.persistence.spi.PersistenceProvider [org.hibernate.ejb.HibernatePersistence]; use [org.hibernate.jpa.HibernatePersistenceProvider] instead.

I've seen that hibernate-entitymanager-4.3.5.Final.jar/META-INF/services/javax.persistence.spi.PersistenceProvider contains those lines :

1 2 3 org.hibernate.jpa.HibernatePersistenceProvider # The deprecated provider, logs warnings when used. org.hibernate.ejb.HibernatePersistence

But as in hibernate-jpa-2.1-api-1.0.0.Final.jar:javax.persistence.spi.PersistenceProviderResolverHolder.PersistenceProviderResolverPerClassLoader.CachingPersistenceProviderResolver.loadResolverClasses(ClassLoader) those ones are added in a HashSet (using addAll method), when listing them (in hibernate-jpa-2.1-api-1.0.0.Final.jar:javax.persistence.Persistence.getProviders()), org.hibernate.ejb.HibernatePersistence is listed first.

Environment

None

Status

Assignee

Steve Ebersole

Reporter

Anthony Ogier

Fix versions

Labels

None

backPortable

None

Suitable for new contributors

None

Requires Release Note

None

Pull Request

None

backportDecision

None

Components

Affects versions

4.3.7
4.3.6
4.3.5

Priority

Major