spring-framework-3.2.4与hibernate-release-4.3.5下使用HibernateDaoSupport抛出异常java.lang.ClassCastException: org.springframework.orm.hibernate4.SessionHolder cannot be cast to org.springframework.orm.hibernate3.SessionHolder。



解决方案:



LZ打开spring的jar包后,发现org.springframework.orm.hibernate4.support中没有HibernateDaoSupport类。即用了hibernate4之后。不能再用HibernateDaoSupportHibernateTemplate类了
改用原生的hibernate语句
获得session:getSessionFactory().getCurrentSession()。


注:LZ是新手。仅仅为交流。如有不当之处。请指出。即使,扔板砖也能够。

相关文章:

  • 2021-09-22
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2021-09-10
  • 2022-02-10
  • 2022-01-23
  • 2021-11-11
  • 2022-12-23
  • 2021-10-09
  • 2022-12-23
相关资源
相似解决方案