1 Reply Latest reply on Sep 22, 2009 1:37 PM by jkronegg

    ClassCastException after upgrading to 2.2.0.GA

      I get the ClassCastException with the components.xml file below. If I change the name of the hibernate session to anything other than 'session' then I get a different error saying the session was null.



      ERROR org.jboss.seam.exception.Exceptions handled and logged exception
      java.lang.IllegalStateException: Could not start transaction
              at org.jboss.seam.jsf.SeamPhaseListener.begin(SeamPhaseListener.java:598
      )
              at org.jboss.seam.jsf.SeamPhaseListener.begin(SeamPhaseListener.java:583
      )
              at org.jboss.seam.jsf.SeamPhaseListener.handleTransactionsBeforePhase(Se
      amPhaseListener.java:327)
              at org.jboss.seam.jsf.SeamPhaseListener.beforeServletPhase(SeamPhaseList
      ener.java:144)
              at org.jboss.seam.jsf.SeamPhaseListener.beforePhase(SeamPhaseListener.ja
      va:118)
              at com.sun.faces.lifecycle.Phase.handleBeforePhase(Phase.java:214)
              at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:96)
              at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:139)
              at javax.faces.webapp.FacesServlet.service(FacesServlet.java:266)
              at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Appl
      icationFilterChain.java:290)
              at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationF
      ilterChain.java:206)
              at org.apache.myfaces.webapp.filter.ExtensionsFilter.doFilter(Extensions
      Filter.java:100)
              at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Appl
      icationFilterChain.java:235)
              at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationF
      ilterChain.java:206)
              at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter
      .java:83)
              at org.jboss.seam.web.IdentityFilter.doFilter(IdentityFilter.java:40)
              at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter
      .java:69)
              at org.jboss.seam.web.MultipartFilter.doFilter(MultipartFilter.java:90)
              at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter
      .java:69)
              at org.jboss.seam.web.ExceptionFilter.doFilter(ExceptionFilter.java:64)
              at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter
      .java:69)
              at org.jboss.seam.web.RedirectFilter.doFilter(RedirectFilter.java:45)
              at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter
      .java:69)
              at org.ajax4jsf.webapp.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:178)


              at org.ajax4jsf.webapp.BaseFilter.handleRequest(BaseFilter.java:290)
              at org.ajax4jsf.webapp.BaseFilter.processUploadsAndHandleRequest(BaseFil
      ter.java:368)
              at org.ajax4jsf.webapp.BaseFilter.doFilter(BaseFilter.java:495)
              at org.jboss.seam.web.Ajax4jsfFilter.doFilter(Ajax4jsfFilter.java:56)
              at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter
      .java:69)
              at org.jboss.seam.web.LoggingFilter.doFilter(LoggingFilter.java:60)
              at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter
      .java:69)
              at org.jboss.seam.web.HotDeployFilter.doFilter(HotDeployFilter.java:53)
              at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter
      .java:69)
              at org.jboss.seam.servlet.SeamFilter.doFilter(SeamFilter.java:158)
              at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Appl
      icationFilterChain.java:235)
              at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationF
      ilterChain.java:206)
              at org.apache.myfaces.webapp.filter.ExtensionsFilter.doFilter(Extensions
      Filter.java:147)
              at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Appl
      icationFilterChain.java:235)
              at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationF
      ilterChain.java:206)
              at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperV
      alve.java:233)
              at org.apache.catalina.core.StandardContextValve.invoke(StandardContextV
      alve.java:191)
              at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.j
      ava:128)
              at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.j
      ava:102)
              at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineVal
      ve.java:109)
              at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.jav
      a:293)
              at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java
      :849)
              at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.proce
      ss(Http11Protocol.java:583)
              at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:45
      4)
              at java.lang.Thread.run(Thread.java:595)
      Caused by: java.lang.ClassCastException: org.apache.catalina.session.StandardSes
      sionFacade
              at org.jboss.seam.transaction.HibernateTransaction.initSession(Hibernate
      Transaction.java:69)
              at org.jboss.seam.transaction.HibernateTransaction.begin(HibernateTransa
      ction.java:80)
              at org.jboss.seam.jsf.SeamPhaseListener.begin(SeamPhaseListener.java:593
      )
              ... 48 more


      components




      <?xml version="1.0" encoding="UTF-8"?>
      <components xmlns="http://jboss.com/products/seam/components"
                  xmlns:core="http://jboss.com/products/seam/core"
                  xmlns:persistence="http://jboss.com/products/seam/persistence"
                  xmlns:transaction="http://jboss.com/products/seam/transaction"
                  xmlns:security="http://jboss.com/products/seam/security"
                  xmlns:theme="http://jboss.com/products/seam/theme"
                  xmlns:cache="http://jboss.com/products/seam/cache"
                  xmlns:web="http://jboss.com/products/seam/web"           
                  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
                  xsi:schemaLocation=
                      "http://jboss.com/products/seam/core http://jboss.com/products/seam/core-2.1.xsd
                       http://jboss.com/products/seam/persistence http://jboss.com/products/seam/persistence-2.1.xsd
                       http://jboss.com/products/seam/transaction http://jboss.com/products/seam/transaction-2.1.xsd 
                       http://jboss.com/products/seam/security http://jboss.com/products/seam/security-2.1.xsd
                       http://jboss.com/products/seam/theme http://jboss.com/products/seam/theme-2.1.xsd
                       http://jboss.com/products/seam/cache http://jboss.com/products/seam/cache-2.1.xsd
                       http://jboss.com/products/seam/web http://jboss.com/products/seam/web-2.1.xsd
                       http://jboss.com/products/seam/components http://jboss.com/products/seam/components-2.1.xsd">
      
       <core:init debug="true"/>
       <core:manager concurrent-request-timeout="500"
        conversation-id-parameter="cid"
        conversation-timeout="120000"/>
        
      
        <transaction:hibernate-session-factory name="session"/>
      
              <transaction:managed-hibernate-session name="session" 
                               auto-create="true"
                 session-factory="session"/>
      
        
          <transaction:hibernate-transaction session="#{session}"/>
      
      
        <security:rule-based-permission-resolver security-rules="#{securityRules}"/>
       <event type="org.jboss.seam.security.notLoggedIn">
        <action execute="#{pageRedirect.captureCurrentView}"/>
       </event>
       <event type="org.jboss.seam.security.loginSuccessful">
        <action execute="#{pageRedirect.returnToCapturedView}"/>
       </event>
      </components>