HibernateTemplate is throwing java.lang.NoSuchMethodError: org.hibernate.Session.getFlushMode() — Spring4.2.6, Hibernate5.2

前端 未结 1 766
孤城傲影
孤城傲影 2020-12-05 22:21

I have looked around similar postings with SessionFactory and missing Main(). My problem is not related to them. Not sure if any jar is a mismatch. I am trying a sample Spri

相关标签:
1条回答
  • 2020-12-05 22:25

    I still couldn't make Spring 4.2.6 to work with Hibernate 5.2.0 (which was just released some days ago), although the error I got is different. I'm still using Hibernate 5.1.0 then.

    Note that on Hibernate 5.1.0 you need two jars: hibernate-core and hibernate-entitymanager.

    [EDIT]Spring 4.2.6 lists Hibernate 5.0.9 as optional dependency so you probably should stick with that version, although 5.1.0 is working fine for me.

    Spring 4.2.6 probably isn't compatible with Hibernate 5.2.0 as this version of hibernate brought some big changes, merging hibernate-core with hibernate-entitymanager and hibernate-java8.

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