3 Replies Latest reply on Aug 9, 2007 1:20 PM by Nick Belaevski

    multiple rich:tree(s) on a page

    Brian Yarger Newbie

      I'm using richfaces 3.0.1, ajax4jsf 1.1.1 (I tried switching back to 3.0.0 and 1.1.0, but the problem was there too).

      I have a page where I'm rendering multiple rich:tree components inside a single page. They are inside a <h:column> of a <h:dataTable>. Whenever I have multiple on a page, I get a ConcurrentModificationException from the saveState method of UIDataAdaptor.

      If I change the rendered element of the <rich:tree> tag so that only the first tree renders (or there is only one row in the table) everything works perfect.

      I've traced through the code, and inside UIDataAdaptor.saveState, there is a line:
      idState.model = getExtendedDataModel().getSerializableModel(
      dataComponentState.getRange());

      This eventually ends up calling UITree.createDataModel(true), which in turn calls UIDataAdaptor.getComponentState() and this method ends up modifying the _statesMap which is being iterated in the saveState method.

      The stack trace I'm getting is:

      java.util.ConcurrentModificationException
      at java.util.HashMap$HashIterator.nextEntry(HashMap.java:793)
      at java.util.HashMap$EntryIterator.next(HashMap.java:833)
      at java.util.HashMap$EntryIterator.next(HashMap.java:831)
      at org.ajax4jsf.ajax.repeat.UIDataAdaptor.saveState(UIDataAdaptor.java:1292)
      at org.richfaces.component.UITree.saveState(UITree.java:754)
      at org.richfaces.component.html.HtmlTree.saveState(HtmlTree.java:1212)
      at javax.faces.component.UIComponentBase.processSaveState(UIComponentBase.java:682)
      at javax.faces.component.UIComponentBase.processSaveState(UIComponentBase.java:676)
      at javax.faces.component.UIComponentBase.processSaveState(UIComponentBase.java:676)
      at javax.faces.component.UIComponentBase.processSaveState(UIComponentBase.java:676)
      at javax.faces.component.UIComponentBase.processSaveState(UIComponentBase.java:676)
      at javax.faces.component.UIComponentBase.processSaveState(UIComponentBase.java:676)
      at org.apache.myfaces.application.jsp.JspStateManagerImpl.getComponentStateToSave(JspStateManagerImpl.java:124)
      at org.apache.myfaces.application.jsp.JspStateManagerImpl.saveSerializedView(JspStateManagerImpl.java:300)
      at org.ajax4jsf.framework.ajax.AjaxStateManager.saveSerializedView(AjaxStateManager.java:90)
      at com.sun.facelets.FaceletViewHandler.renderView(FaceletViewHandler.java:594)
      at org.ajax4jsf.framework.ViewHandlerWrapper.renderView(ViewHandlerWrapper.java:108)
      at org.ajax4jsf.framework.ajax.AjaxViewHandler.renderView(AjaxViewHandler.java:233)
      at org.apache.myfaces.lifecycle.RenderResponseExecutor.execute(RenderResponseExecutor.java:41)
      at org.apache.myfaces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:132)
      at javax.faces.webapp.FacesServlet.service(FacesServlet.java:140)
      at com.frappier.aims.web.servlet.ErrorHandler.service(ErrorHandler.java:69)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
      at org.apache.myfaces.webapp.filter.ExtensionsFilter.doFilter(ExtensionsFilter.java:100)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
      at org.ajax4jsf.framework.ajax.xmlfilter.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:127)
      at org.ajax4jsf.framework.ajax.xmlfilter.BaseFilter.doFilter(BaseFilter.java:277)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
      at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:264)
      at org.acegisecurity.intercept.web.FilterSecurityInterceptor.invoke(FilterSecurityInterceptor.java:107)
      at org.acegisecurity.intercept.web.FilterSecurityInterceptor.doFilter(FilterSecurityInterceptor.java:72)
      at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:274)
      at org.acegisecurity.ui.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:110)
      at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:274)
      at org.acegisecurity.providers.anonymous.AnonymousProcessingFilter.doFilter(AnonymousProcessingFilter.java:125)
      at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:274)
      at org.acegisecurity.wrapper.SecurityContextHolderAwareRequestFilter.doFilter(SecurityContextHolderAwareRequestFilter.java:81)
      at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:274)
      at org.acegisecurity.ui.logout.LogoutFilter.doFilter(LogoutFilter.java:106)
      at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:274)
      at org.acegisecurity.context.HttpSessionContextIntegrationFilter.doFilter(HttpSessionContextIntegrationFilter.java:229)
      at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:274)
      at org.acegisecurity.concurrent.ConcurrentSessionFilter.doFilter(ConcurrentSessionFilter.java:95)
      at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:274)
      at org.acegisecurity.util.FilterChainProxy.doFilter(FilterChainProxy.java:148)
      at org.acegisecurity.util.FilterToBeanProxy.doFilter(FilterToBeanProxy.java:98)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
      at org.apache.myfaces.webapp.filter.ExtensionsFilter.doFilter(ExtensionsFilter.java:147)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
      at org.springframework.orm.hibernate3.support.OpenSessionInViewFilter.doFilterInternal(OpenSessionInViewFilter.java:174)
      at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:77)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
      at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
      at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
      at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
      at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
      at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
      at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
      at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869)
      at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664)
      at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
      at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:80)
      at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
      at java.lang.Thread.run(Thread.java:619)

      Any ideas? Are multiple rich:tree components allowed within the same form on a single page? My rich:tree tag looks like:

      <rich:tree toggleOnClick="true" switchType="client" rendered="true"
      value="#{backingBean.athleteTestFormTreeNodes[testResult.athletetestformid]}"/>

      Brian