java.lang.ClassCastException: org.springframework.orm.hibernate4.SessionHolder cannot be cast to org.springframework.orm.hibernate5.SessionHolder

Spring JIRA | Vadim Marchenko | 2 years ago
tip
Your exception is missing from the Samebug knowledge base.
Here are the best solutions we found on the Internet.
Click on the to mark the helpful solution and get rewards for you help.

    Root Cause Analysis

    1. java.lang.ClassCastException

      org.springframework.orm.hibernate4.SessionHolder cannot be cast to org.springframework.orm.hibernate5.SessionHolder

      at org.springframework.orm.hibernate5.HibernateTemplate.prepareQuery()
    2. org.springframework.orm
      HibernateTemplate$CloseSuppressingInvocationHandler.invoke
      1. org.springframework.orm.hibernate5.HibernateTemplate.prepareQuery(HibernateTemplate.java:1154)[spring-orm-4.2.1.BUILD-SNAPSHOT.jar:4.2.1.BUILD-SNAPSHOT]
      2. org.springframework.orm.hibernate5.HibernateTemplate$CloseSuppressingInvocationHandler.invoke(HibernateTemplate.java:1247)[spring-orm-4.2.1.BUILD-SNAPSHOT.jar:4.2.1.BUILD-SNAPSHOT]
      2 frames
    3. com.sun.proxy
      $Proxy102.createQuery
      1. com.sun.proxy.$Proxy102.createQuery(Unknown Source)[na:na]
      1 frame
    4. com.eedgesoft.dao
      RSSJobFactory$1.doInHibernate
      1. com.eedgesoft.dao.model.conf.jobs.feed.RSSJobFactory$1.doInHibernate(RSSJobFactory.java:37)[classes/:na]
      2. com.eedgesoft.dao.model.conf.jobs.feed.RSSJobFactory$1.doInHibernate(RSSJobFactory.java:1)[classes/:na]
      2 frames
    5. org.springframework.orm
      HibernateTemplate.execute
      1. org.springframework.orm.hibernate5.HibernateTemplate.doExecute(HibernateTemplate.java:341)[spring-orm-4.2.1.BUILD-SNAPSHOT.jar:4.2.1.BUILD-SNAPSHOT]
      2. org.springframework.orm.hibernate5.HibernateTemplate.execute(HibernateTemplate.java:296)[spring-orm-4.2.1.BUILD-SNAPSHOT.jar:4.2.1.BUILD-SNAPSHOT]
      2 frames