Skip to content

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

@spring-projects-issues

Description

@spring-projects-issues
Collaborator

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

spring-projects-issues

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.

added this to the 4.3.1 milestone on Jan 11, 2019
rajvpitian

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.

bclozel

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.

rajvpitian

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: dataIssues in data modules (jdbc, orm, oxm, tx)type: bugA general bug

Type

No type

Projects

No projects

Relationships

None yet

    Development

    No branches or pull requests

      Participants

      @bclozel@jhoeller@spring-projects-issues@rajvpitian

      Issue actions

        NoSuchMethodError for SessionFactoryImplementor.getProperties() with Hibernate 5.1 [SPR-14365] · Issue #18937 · spring-projects/spring-framework