Results 1 to 2 of 2

Thread: No HibernateDaoSupport for hibernate4

Threaded View

  1. #1
    Join Date
    Aug 2009
    Posts
    4

    Question No HibernateDaoSupport for hibernate4

    Am attempting to upgrade from Spring 3.0.5.RELEASE to 3.2.0.RELEASE. Am also upgrading Hibernate to 4.1.9.Final.

    The SpringFramework has updated hibernate4 support classes such as SessionFactoryUtils. However, there is no hibernate4 version of HibernateDaoSupport. Also, hibernate3.HibernateDaoSupport uses hibernate3.SessionFactoryUtils.

    So in trying to obtain a Session, I'm seeing this error:

    Caused by: java.lang.NoSuchMethodError: org.hibernate.SessionFactory.openSession()Lorg/hibernate/classic/Session;
    at org.springframework.orm.hibernate3.SessionFactoryU tils.doGetSession(SessionFactoryUtils.java:323)
    at org.springframework.orm.hibernate3.SessionFactoryU tils.getSession(SessionFactoryUtils.java:202)
    at org.springframework.orm.hibernate3.support.Hiberna teDaoSupport.getSession(HibernateDaoSupport.java:1 68)
    I think the error is because Hibernate 4.1's SessionFactory's openSession() does not return an org.hibernate.classic.Session; it returns an org.hibernate.Session.

    We're using the hibernate4.LocalSessionFactoryBean as the factory for the SessionFactory

    Honestly, I'm not 100% sure what is causing this problem, but I will say that in opening the hibernate3.SessionFactoryUtils class, I do see all kinds of errors because the Hibernate 4.x API is different from the Hibernate 3.x.

    I'm thinking what is needed is a org.springframework.orm.hibernate4.HibernateDaoSup port that uses other Spring hibernate4.* references instead of the hibernate3.* references.

    Any thoughts?

    --
    jack
    Last edited by madjack; Dec 20th, 2012 at 01:56 PM.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •