2 Replies Latest reply on Mar 30, 2009 9:54 AM by leo foto

    ClassCastException when iterating over PanelMenuItem

    leo foto Newbie

      I am hitting an issue similar to the one reported in the following
      https://jira.jboss.org/jira/browse/RF-570
      but no real solution has been provided on this bug and the status has been set to resolved. Any help / workaround will be greatly appreciated.

      I am using RichFaces 3.3.0.GA
      Even if I replace the a4j:repeat with ui:repeat (from facelets tags) I get the same ClassCastexception.

      I am trying do the following

      <rich:panelMenu style="width:200px" mode="ajax"
       iconExpandedGroup="disc" iconCollapsedGroup="disc"
       iconExpandedTopGroup="chevronUp" iconGroupTopPosition="right"
       iconCollapsedTopGroup="chevronDown" iconCollapsedTopPosition="right" >
      
       <a4j:repeat value="#{screenMenuGroup.menuItemList}" var="menuItem">
       <rich:panelMenuGroup label="#{menuItem.label}" rendered="#{menuItem.parentStatus eq 'true'}">
       <rich:panelMenuItem label="#{menuItem.label}" action="#{menuItem.getAction}" rendered="#{menuItem.parentStatus eq 'false'}">
       </rich:panelMenuItem>
       </rich:panelMenuGroup>
       </a4j:repeat>
       </rich:panelMenu>



      Here's my complete stack trace

      java.lang.ClassCastException: org.ajax4jsf.component.html.HtmlAjaxRepeat incompatible with org.richfaces.component.UIPanelMenuItem
       org.richfaces.renderkit.html.PanelMenuRenderer.insertScript(PanelMenuRenderer.java:142)
       org.richfaces.renderkit.html.HtmlPanelMenuRenderer.doEncodeEnd(HtmlPanelMenuRenderer.java:261)
       org.richfaces.renderkit.html.HtmlPanelMenuRenderer.doEncodeEnd(HtmlPanelMenuRenderer.java:272)
       org.ajax4jsf.renderkit.RendererBase.encodeEnd(RendererBase.java:135)
       javax.faces.component.UIComponentBase.encodeEnd(UIComponentBase.java:624)
       org.ajax4jsf.renderkit.RendererBase.renderChild(RendererBase.java:286)
       org.ajax4jsf.renderkit.RendererBase.renderChildren(RendererBase.java:262)
       org.ajax4jsf.renderkit.RendererBase.renderChild(RendererBase.java:284)
       org.ajax4jsf.renderkit.RendererBase.renderChildren(RendererBase.java:262)
       org.ajax4jsf.renderkit.RendererBase.renderChild(RendererBase.java:284)
       org.ajax4jsf.renderkit.RendererBase.renderChildren(RendererBase.java:262)
       org.ajax4jsf.renderkit.RendererBase.renderChild(RendererBase.java:284)
       org.ajax4jsf.renderkit.RendererBase.renderChildren(RendererBase.java:262)
       org.richfaces.renderkit.html.PanelRenderer.doEncodeChildren(PanelRenderer.java:220)
       org.richfaces.renderkit.html.PanelRenderer.doEncodeChildren(PanelRenderer.java:215)
       org.ajax4jsf.renderkit.RendererBase.encodeChildren(RendererBase.java:121)
       javax.faces.component.UIComponentBase.encodeChildren(UIComponentBase.java:611)
       org.apache.myfaces.shared_impl.renderkit.RendererUtils.renderChild(RendererUtils.java:516)
       org.apache.myfaces.shared_impl.renderkit.html.HtmlGridRendererBase.renderChildren(HtmlGridRendererBase.java:231)
       org.apache.myfaces.shared_impl.renderkit.html.HtmlGridRendererBase.encodeEnd(HtmlGridRendererBase.java:102)
       javax.faces.component.UIComponentBase.encodeEnd(UIComponentBase.java:624)
       javax.faces.component.UIComponent.encodeAll(UIComponent.java:261)
       javax.faces.component.UIComponent.encodeAll(UIComponent.java:257)
       com.sun.facelets.FaceletViewHandler.renderView(FaceletViewHandler.java:592)
       org.ajax4jsf.application.ViewHandlerWrapper.renderView(ViewHandlerWrapper.java:100)
       org.ajax4jsf.application.AjaxViewHandler.renderView(AjaxViewHandler.java:176)
       org.springframework.faces.webflow.JsfView.render(JsfView.java:94)
       org.springframework.webflow.engine.ViewState.render(ViewState.java:245)
       org.springframework.webflow.engine.ViewState.resume(ViewState.java:204)
       org.springframework.webflow.engine.Flow.resume(Flow.java:545)
       org.springframework.webflow.engine.impl.FlowExecutionImpl.resume(FlowExecutionImpl.java:262)
       org.springframework.webflow.executor.FlowExecutorImpl.resumeExecution(FlowExecutorImpl.java:163)
       org.springframework.webflow.mvc.servlet.FlowHandlerAdapter.handle(FlowHandlerAdapter.java:173)
       org.springframework.webflow.mvc.servlet.FlowController.handleRequest(FlowController.java:174)
       org.springframework.web.servlet.mvc.SimpleControllerHandlerAdapter.handle(SimpleControllerHandlerAdapter.java:48)
       org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:875)
       org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:807)
       org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:571)
       org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:501)
       javax.servlet.http.HttpServlet.service(HttpServlet.java:743)
       javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
       org.ajax4jsf.webapp.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:178)
       org.ajax4jsf.webapp.BaseFilter.handleRequest(BaseFilter.java:290)
       org.ajax4jsf.webapp.BaseFilter.processUploadsAndHandleRequest(BaseFilter.java:390)
       org.ajax4jsf.webapp.BaseFilter.doFilter(BaseFilter.java:517)
       org.springframework.security.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:378)
       org.springframework.security.intercept.web.FilterSecurityInterceptor.invoke(FilterSecurityInterceptor.java:109)
       org.springframework.security.intercept.web.FilterSecurityInterceptor.doFilter(FilterSecurityInterceptor.java:83)
       org.springframework.security.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:390)
       org.springframework.security.ui.SessionFixationProtectionFilter.doFilterHttp(SessionFixationProtectionFilter.java:67)
       org.springframework.security.ui.SpringSecurityFilter.doFilter(SpringSecurityFilter.java:53)
       org.springframework.security.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:390)
       org.springframework.security.ui.ExceptionTranslationFilter.doFilterHttp(ExceptionTranslationFilter.java:101)
       org.springframework.security.ui.SpringSecurityFilter.doFilter(SpringSecurityFilter.java:53)
       org.springframework.security.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:390)
       org.springframework.security.wrapper.SecurityContextHolderAwareRequestFilter.doFilterHttp(SecurityContextHolderAwareRequestFilter.java:91)
       org.springframework.security.ui.SpringSecurityFilter.doFilter(SpringSecurityFilter.java:53)
       org.springframework.security.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:390)
       org.springframework.security.ui.preauth.AbstractPreAuthenticatedProcessingFilter.doFilterHttp(AbstractPreAuthenticatedProcessingFilter.java:69)
       org.springframework.security.ui.SpringSecurityFilter.doFilter(SpringSecurityFilter.java:53)
       org.springframework.security.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:390)
       org.springframework.security.ui.logout.LogoutFilter.doFilterHttp(LogoutFilter.java:89)
       org.springframework.security.ui.SpringSecurityFilter.doFilter(SpringSecurityFilter.java:53)
       org.springframework.security.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:390)
       org.springframework.security.context.HttpSessionContextIntegrationFilter.doFilterHttp(HttpSessionContextIntegrationFilter.java:235)
       org.springframework.security.ui.SpringSecurityFilter.doFilter(SpringSecurityFilter.java:53)
       org.springframework.security.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:390)
       org.springframework.security.concurrent.ConcurrentSessionFilter.doFilterHttp(ConcurrentSessionFilter.java:99)
       org.springframework.security.ui.SpringSecurityFilter.doFilter(SpringSecurityFilter.java:53)
       org.springframework.security.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:390)
       org.springframework.security.util.FilterChainProxy.doFilter(FilterChainProxy.java:175)
       org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:236)
       org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:167)