4 Replies Latest reply on Oct 2, 2007 11:21 AM by Yurii Kartsev

    rich:tree stateAdvisor: java.lang.ClassCastException

    Yurii Kartsev Apprentice

      Good afternoon.

      I can't understand the reason of this exception...

      I have WAR and JAR in one EAR, deployed on the server. If I put DepartmentTreeStateAdvisor class in my WAR's package - everything works perfectly. But if only I move it in my JAR's package - I got this exception: java.lang.ClassCastException: netinfo.hrdslr.tree.DepartmentTreeStateAdvisor


      I have netinfo.hrdslr.tree package in JAR, there are DepartmentTreeNode and PostbackPhaseListener classes. And I just can't add here and DepartmentTreeStateAdvisor, because of that exception.

      By the way - all my other action methods I use with richFaces are in the bean, which is in JAR, not in WAR. And everything works. The exception is only rich:tree with DepartmentTreeStateAdvisor...

      Why?

      Thanks in advance!


      P.S.: For sure I always change faces-config.xml when moving DepartmentTreeStateAdvisor from one package to another.

      P.P.S.: departmentTreeStateAdvisor is in my application variables as: netinfo.hrdslr.tree.DepartmentTreeStateAdvisor@13be7c0


      Here is my tree:

      <h:form id="employeesDataTable_form">
      
       <rich:tree style="width:250px" styleClass="tree" switchType="ajax"
       ajaxSubmitSelection="true" showConnectingLines="true" toggleOnClick="true"
       stateAdvisor="#{departmentTreeStateAdvisor}" changeExpandListener="#{amBean.onDepartmentTreeExpand}">
       <rich:recursiveTreeNodesAdaptor roots="#{amBean.departmentsTreeRoots}" var="item" nodes="#{item.nodes}" />
       </rich:tree>
      
       </h:form>



      Here is my exception stack trace:
      java.lang.ClassCastException: netinfo.hrdslr.tree.DepartmentTreeStateAdvisor
       at org.richfaces.renderkit.TreeRendererBase$DataVisitorWithLastElement.processAdvisors(TreeRendererBase.java:302)
       at org.richfaces.renderkit.TreeRendererBase$DataVisitorWithLastElement.process(TreeRendererBase.java:239)
       at org.richfaces.model.AbstractTreeDataModel.processElement(AbstractTreeDataModel.java:132)
       at org.richfaces.model.StackingTreeModel.doWalk(StackingTreeModel.java:270)
       at org.richfaces.model.StackingTreeModel$Visitor1.process(StackingTreeModel.java:383)
       at org.richfaces.model.StackingTreeModel$ShiftingDataVisitor.process(StackingTreeModel.java:418)
       at org.richfaces.model.StackingTreeModel$1.process(StackingTreeModel.java:308)
       at org.richfaces.model.SequenceDataModel.walk(SequenceDataModel.java:59)
       at org.richfaces.model.StackingTreeModel.doWalk(StackingTreeModel.java:292)
       at org.richfaces.model.StackingTreeModel.walk(StackingTreeModel.java:355)
       at org.richfaces.component.UITree.walk(UITree.java:320)
       at org.richfaces.renderkit.TreeRendererBase.writeContent(TreeRendererBase.java:616)
       at org.richfaces.renderkit.TreeRendererBase.encodeChildren(TreeRendererBase.java:559)
       at javax.faces.component.UIComponentBase.encodeChildren(UIComponentBase.java:809)
       at javax.faces.component.UIComponent.encodeAll(UIComponent.java:886)
       at javax.faces.render.Renderer.encodeChildren(Renderer.java:137)
       at javax.faces.component.UIComponentBase.encodeChildren(UIComponentBase.java:809)
       at javax.faces.component.UIComponent.encodeAll(UIComponent.java:886)
       at javax.faces.component.UIComponent.encodeAll(UIComponent.java:892)
       at com.sun.facelets.FaceletViewHandler.renderView(FaceletViewHandler.java:577)
       at org.ajax4jsf.application.ViewHandlerWrapper.renderView(ViewHandlerWrapper.java:108)
       at org.ajax4jsf.application.AjaxViewHandler.renderView(AjaxViewHandler.java:216)
       at com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:106)
       at com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:251)
       at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:144)
       at javax.faces.webapp.FacesServlet.service(FacesServlet.java:245)
       at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
       at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
       at org.ajax4jsf.webapp.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:141)
       at org.ajax4jsf.webapp.BaseFilter.doFilter(BaseFilter.java:281)
       at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
       at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
       at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
       at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
       at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
       at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:230)
       at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
       at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:179)
       at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:84)
       at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
       at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:104)
       at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:156)
       at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
       at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:241)
       at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
       at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:580)
       at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
       at java.lang.Thread.run(Thread.java:595)