"NoSuchMethodError: org.hibernate.Session.getFlushMode()Lorg/hibernate/FlushMode" using Spring Framework/Data in JBoss EAP 7.2

Solution Verified - Updated -

Issue

Encountering an error when Spring code attempts to access Hibernate classes

... java.lang.NoSuchMethodError: org.hibernate.Session.getFlushMode()Lorg/hibernate/FlushMode;
        at org.springframework.orm.jpa.vendor.HibernateJpaDialect.prepareFlushMode(HibernateJpaDialect.java:183)
        at org.springframework.orm.jpa.vendor.HibernateJpaDialect.beginTransaction(HibernateJpaDialect.java:169)
        at org.springframework.orm.jpa.JpaTransactionManager.doBegin(JpaTransactionManager.java:380)
        ...

Environment

  • Red Hat JBoss Enterprise Application Platform (EAP) 7.2
  • Hibernate 5.3
  • Spring Framework
    • 4.x
    • 5.0

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.

Current Customers and Partners

Log in for full access

Log In

New to Red Hat?

Learn more about Red Hat subscriptions

Using a Red Hat product through a public cloud?

How to access this content