Uploaded image for project: 'Seam 2'
  1. Seam 2
  2. JBSEAM-4936

SEAM 2.3 - Spring 3 - Hibernate 4 Integration bug

    Details

    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: Major
    • Resolution: Done
    • Affects Version/s: 2.3.0.BETA1
    • Fix Version/s: 2.3.0.BETA2
    • Component/s: Spring
    • Labels:
      None
    • Environment:

      Windows 7, Tomcat 7.0.20

      Description

      When I try to integrate Seam 2.3.0 Beta1 with Spring 3.1 and Hibernate 4, I've this exception when I access to hibernate current session.

      Caused by: java.lang.ClassCastException: org.springframework.orm.hibernate4.SessionHolder cannot be cast to org.springframework.orm.hibernate3.SessionHolder
      at org.springframework.orm.hibernate3.SessionFactoryUtils.doGetSession(SessionFactoryUtils.java:289) ~[spring-orm-3.1.1.RELEASE.jar:3.1.1.RELEASE]
      at org.springframework.orm.hibernate3.SessionFactoryUtils.doGetSession(SessionFactoryUtils.java:258) ~[spring-orm-3.1.1.RELEASE.jar:3.1.1.RELEASE]
      at org.jboss.seam.ioc.spring.SeamManagedSessionFactoryBean$SeamManagedSessionFactoryHandler.invoke(SeamManagedSessionFactoryBean.java:178) ~[jboss-seam-ioc-2.3.0.Beta1.jar:2.3.0.Beta1]
      at $Proxy52.getCurrentSession

      If commiters wants more details on configuration, they could find on discussion link below.

      I search in "org.jboss.seam.ioc.spring.SeamManagedSessionFactoryBean" at line 178 and I found a dependency to "org.springframework.orm.hibernate3.SessionFactoryUtils". Unfortunately, Spring use "org.springframework.orm.hibernate4.SessionFactoryUtils" to manage Hibernate api 4.x. And I can't return to hibernate 3.x api because Seam 2.3 work only with hibernate api 4.x.

      Also I think issue resolution is only change import in SeamManagedSessionFactoryBean.

        Gliffy Diagrams

          Attachments

            Issue Links

              Activity

                People

                • Assignee:
                  manaRH Marek Novotny
                  Reporter:
                  stephane.remillieux Stephane REMI
                • Votes:
                  0 Vote for this issue
                  Watchers:
                  2 Start watching this issue

                  Dates

                  • Created:
                    Updated:
                    Resolved: