ICEfaces
  1. ICEfaces
  2. ICE-8139

ConcurrentModificationException thrown by chat portlet

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 3.1.0.BETA2, 3.1
    • Component/s: Framework, Sample Apps
    • Labels:
      None
    • Environment:
      Chat

      Description

      The chat-portlet example is throwing the following exception:

      java.util.ConcurrentModificationException
      at java.util.SubList.checkForComodification(AbstractList.java:752)
      at java.util.SubList.size(AbstractList.java:625)
      at javax.faces.model.ListDataModel.getRowCount(ListDataModel.java:131)
      at com.sun.faces.facelets.component.UIRepeat.visitChildren(UIRepeat.java:709)
      at com.sun.faces.facelets.component.UIRepeat.visitTree(UIRepeat.java:642)
      at javax.faces.component.UIComponent.visitTree(UIComponent.java:1601)
      at javax.faces.component.UIComponent.visitTree(UIComponent.java:1601)
      at javax.faces.component.UIComponent.visitTree(UIComponent.java:1601)
      at javax.faces.component.UIForm.visitTree(UIForm.java:344)
      at javax.faces.component.UIComponent.visitTree(UIComponent.java:1601)
      at javax.faces.component.UIComponent.visitTree(UIComponent.java:1601)
      at org.icefaces.impl.event.RestoreResourceDependencies.processEvent(RestoreResourceDependencies.java:24)
      at javax.faces.event.SystemEvent.processListener(SystemEvent.java:106)
      at com.sun.faces.application.ApplicationImpl.processListeners(ApplicationImpl.java:2168)
      at com.sun.faces.application.ApplicationImpl.invokeListenersFor(ApplicationImpl.java:2144)
      at com.sun.faces.application.ApplicationImpl.publishEvent(ApplicationImpl.java:302)
      at com.sun.faces.application.ApplicationImpl.publishEvent(ApplicationImpl.java:246)
      at javax.faces.application.ApplicationWrapper.publishEvent(ApplicationWrapper.java:670)
      at javax.faces.component.UIComponentBase.encodeBegin(UIComponentBase.java:812)
      at javax.faces.component.UIViewRoot.encodeBegin(UIViewRoot.java:962)
      at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1755)
      at com.sun.faces.application.view.FaceletViewHandlingStrategy.renderView(FaceletViewHandlingStrategy.java:391)
      at com.sun.faces.application.view.MultiViewHandler.renderView(MultiViewHandler.java:131)
      at javax.faces.application.ViewHandlerWrapper.renderView(ViewHandlerWrapper.java:288)
      at com.liferay.faces.bridge.application.ViewHandlerImpl.renderView(ViewHandlerImpl.java:91)
      at com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:121)
      at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:101)
      at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:139)
      at com.liferay.faces.bridge.BridgePhaseResourceImpl.execute(BridgePhaseResourceImpl.java:120)
      at com.liferay.faces.bridge.BridgeImpl.doFacesRequest(BridgeImpl.java:96)
      ...

        Activity

        Hide
        Deryk Sinotte added a comment -

        Okay, I ran the non-portlet version of chat and had the same problem. I was able to code around it in the application but it may indicate there is a deeper problem.

        In the ChatRoom bean (an application scoped bean that acts as the main data hub for the chat messages) I had to adjust how it determined the sub list of messages to return. It was originally using:

        return messages.subList(start, start + number);

        But the use of subList with the new RestoreResourceDependencies event listener lead to the exception. By not using the subList method and do it "old school":

        List subList = new ArrayList();
        for(int index = start; index < (start+number); index++)

        { subList.add(messages.get(index)); }

        return subList;

        I was able to get around the problem. However, this might be indicative of a more subtle problem.

        Show
        Deryk Sinotte added a comment - Okay, I ran the non-portlet version of chat and had the same problem. I was able to code around it in the application but it may indicate there is a deeper problem. In the ChatRoom bean (an application scoped bean that acts as the main data hub for the chat messages) I had to adjust how it determined the sub list of messages to return. It was originally using: return messages.subList(start, start + number); But the use of subList with the new RestoreResourceDependencies event listener lead to the exception. By not using the subList method and do it "old school": List subList = new ArrayList(); for(int index = start; index < (start+number); index++) { subList.add(messages.get(index)); } return subList; I was able to get around the problem. However, this might be indicative of a more subtle problem.
        Hide
        Deryk Sinotte added a comment -

        I've modified the ChatRoom bean in the sample to avoid the issue but it's possible the that issue is related to the tree visits done in the RestoreResourceDependencies. It seems like sometimes it runs more than once per request.

        Show
        Deryk Sinotte added a comment - I've modified the ChatRoom bean in the sample to avoid the issue but it's possible the that issue is related to the tree visits done in the RestoreResourceDependencies. It seems like sometimes it runs more than once per request.

          People

          • Assignee:
            Deryk Sinotte
            Reporter:
            Deryk Sinotte
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: