Seam 2
  1. Seam 2
  2. JBSEAM-4936

SEAM 2.3 - Spring 3 - Hibernate 4 Integration bug

    Details

    • Type: Bug Bug
    • Status: Closed Closed (View Workflow)
    • Priority: Major 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
    • Affects:
      Compatibility/Configuration
    • Similar Issues:
      Show 10 results 

      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.

        Issue Links

          Activity

          Hide
          Marek Novotny
          added a comment -

          no reference to hibernate 3 usage in seam 2.3 IOC anymore.
          see https://source.jboss.org/changelog/Seam/?cs=14498

          Show
          Marek Novotny
          added a comment - no reference to hibernate 3 usage in seam 2.3 IOC anymore. see https://source.jboss.org/changelog/Seam/?cs=14498
          Hide
          Marek Novotny
          added a comment -

          Closing as 2.3.0.Beta2 is already released 3 months.

          Show
          Marek Novotny
          added a comment - Closing as 2.3.0.Beta2 is already released 3 months.

            People

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

              Dates

              • Created:
                Updated:
                Resolved: