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:
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.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)
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


Reply With Quote
