Encountered a deprecated javax.persistence.spi.PersistenceProvider

前端 未结 7 722
甜味超标
甜味超标 2020-12-03 06:40

when you use spring & Hibernate, have you ever met a log warning that says

WARN o.hibernate.ejb.HibernatePersistence - HHH015016: Encountered a

7条回答
  •  心在旅途
    2020-12-03 07:29

    Had this problem while working with JPA's Entity Manager in Spring context, having transaction-type="RESOURCE_LOCAL" in persistence.xml.

    It's not always a bug. I actually had the wrong provider configured.

    I just changed the provider in persistence.xml from

    org.hibernate.ejb.HibernatePersistence
    

    to

    org.hibernate.jpa.HibernatePersistenceProvider
    

    and it works fine.

    Notice that the package changed from EJB to JPA

提交回复
热议问题