Hibernate 5.2.7 - java.lang.NoSuchMethodError: org.hibernate.engine.spi.SessionFactoryImplementor.getProperties()Ljava/util/Map;

后端 未结 2 2038
遇见更好的自我
遇见更好的自我 2020-12-16 14:47

while using Hibernate 5.2.7 in a Gradle Java Project to connect to a MariaDB 10.1.19, I am getting an Exception in thread \"main\" java.lang.NoSuchMethodError: org.hib

相关标签:
2条回答
  • 2020-12-16 15:22

    What version of the Gradle do you have?

    I ask, because I have the same error which occurs after upgrade Gradle from 3.5 to 4.3. The same Hibernate version (5.2.9), the same Spring Boot (1.5.8) but in Gradle 3.5. - OK, 4.3 fail.

    I've tested and latest version working fine was for me 3.5.1. I've tested versions from 4.0 to 4.4-rc-6 (latest at this moment).

    distributionUrl=https\://services.gradle.org/distributions/gradle-3.5.1-all.zip
    
    0 讨论(0)
  • 2020-12-16 15:39

    This problem is caused by having an old, incompatible copy of the JPA API on the classpath.

    Specifically:

    • javax.persistence:persistence-api:1.0.2

    Conflicts with the right version of the JPA 2.1 API:

    • org.hibernate.javax.persistence:hibernate-jpa-2.1-api:1.0.0.Final

    Unfortunately Maven 3 is still unable to handle re-distributions of the same artifacts, which are sometimes necessary.

    0 讨论(0)
提交回复
热议问题