Skip to content

NoSuchMethodError for SessionFactoryImplementor.getProperties() with Hibernate 5.1 [SPR-14365] #18937

Closed

Description

@spring-projects-issues

Andy Wilkinson opened SPR-14365 and commented

The signature of SessionFactoryImplementor.getProperties() changed in 5.2 to return Map rather than Properties. This leads to a NoSuchMethodError with 5.1 (and 5.0 too, I presume):

java.lang.NoSuchMethodError: org.hibernate.engine.spi.SessionFactoryImplementor.getProperties()Ljava/util/Map;
	at org.springframework.orm.hibernate5.SessionFactoryUtils.getDataSource(SessionFactoryUtils.java:153)
	at org.springframework.orm.hibernate5.HibernateTransactionManager.afterPropertiesSet(HibernateTransactionManager.java:353)
	at org.springframework.orm.hibernate5.HibernateTransactionManager.<init>(HibernateTransactionManager.java:145)

Affects: 4.3 GA

Issue Links:

1 votes, 8 watchers

Activity

  1. spring-projects-issues commented on Jun 15, 2016

    @spring-projects-issues
    CollaboratorAuthor

    Juergen Hoeller commented

    We're reflectively obtaining the getProperties handle now, avoiding binary compatibility issues.

  2. added
    type: bug
    in: data
    on Jan 11, 2019
  3. added this to the 4.3.1 milestone on Jan 11, 2019
  4. rajvpitian commented on Jan 17, 2023

    @rajvpitian

    Juergen Hoeller commented

    We're reflectively obtaining the getProperties handle now, avoiding binary compatibility issues.

    Hello Juergen,
    Could you please mention what do you mean by reflectively obtaining 'getProperties' here? I do have the same issue when migrating to 4+ to 5.6+. I am using ANT project and hence cannot resolve dependencies through Maven and gradle. It would be great if you give any reference to fix this issue.

  5. bclozel commented on Jan 17, 2023

    @bclozel
    Member

    @rajvpitian this issue is now probably outdated as we've released two major versions of Spring Framework in the meantime and upgraded to Hibernate 6.0. In our Hibernate 5.x support, you'll see a reflection call that probably comes from this issue.

  6. rajvpitian commented on Jan 18, 2023

    @rajvpitian

    @rajvpitian this issue is now probably outdated as we've released two major versions of Spring Framework in the meantime and upgraded to Hibernate 6.0. In our Hibernate 5.x support, you'll see a reflection call that probably comes from this issue.

    Hi @bclozel, we have to stick to 5.6 version as we have a legacy application. I am facing this while upgrading from hibernate 4.1.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

in: datatype: bug

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions