[jbossseam-issues] [JBoss JIRA] Closed: (JBSEAM-1708) Hibernate Framework classes look for an HibernateSession with name "session" and that's a HttpSession

Gavin King (JIRA) jira-events at lists.jboss.org
Sun Jul 22 12:50:47 EDT 2007


     [ http://jira.jboss.com/jira/browse/JBSEAM-1708?page=all ]

Gavin King closed JBSEAM-1708.
------------------------------

    Resolution: Duplicate Issue

> Hibernate Framework classes look for an HibernateSession with name "session" and that's a HttpSession
> -----------------------------------------------------------------------------------------------------
>
>                 Key: JBSEAM-1708
>                 URL: http://jira.jboss.com/jira/browse/JBSEAM-1708
>             Project: JBoss Seam
>          Issue Type: Bug
>          Components: Framework
>    Affects Versions: 2.0.0.BETA1
>         Environment: Hibernate 3, Tomcat 6.0.13, Java 6, Windows XP
>            Reporter: Ralph Schaer
>
> The Hibernate framework classes (HibernateEntityHome, HibernateEntityQuery) looking for a HibernateSession in the context with name "session". The problem is that "session" is already bound to a HttpSession. 
> The result is that the program throws this exception 
> Caused by: java.lang.ClassCastException: org.apache.catalina.session.StandardSessionFacade cannot be cast to org.hibernate.Session at org.jboss.seam.transaction.HibernateTransaction.initSession(HibernateTransaction.java:68)
> As a workaround I override the getPersistenceContext() in every Home and Query class
>   @Override
>   protected String getPersistenceContextName() {
>     return "hibernateSession";
>   }
> components.xml looks like this.
>   <persistence:hibernate-session-factory name="hibernateSessionFactory"  />
>   <persistence:managed-hibernate-session name="hibernateSession" auto-create="true"   
>                                          session-factory="#{hibernateSessionFactory}" />
>   <transaction:hibernate-transaction session="#{hibernateSession}" />

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.jboss.com/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        



More information about the seam-issues mailing list