ICEfaces
  1. ICEfaces
  2. ICE-3313

Concurrent Modification Exception with many pushes in portlet environment

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 1.7.1
    • Fix Version/s: 1.7.2
    • Component/s: Bridge
    • Labels:
      None
    • Environment:
      Liferay 4.4.1, Jboss 4.2.2

      Description

      The following exception is thrown when there are many server initiated updates occurring at the same time from different portlets:

      2008-06-15 16:54:48,707 ERROR
      [org.apache.catalina.core.ContainerBase.[jboss.web].[localhost].[/slp-gqast1.com-web].[Persistent
      Faces Servlet]] Servlet.service() for servlet Persi
      stent Faces Servlet threw exception
      java.util.ConcurrentModificationException
              at java.util.HashMap$HashIterator.nextEntry(HashMap.java:841)
              at java.util.HashMap$EntryIterator.next(HashMap.java:883)
              at java.util.HashMap$EntryIterator.next(HashMap.java:881)
              at
      com.icesoft.faces.context.BridgeExternalContext.collectBundles(BridgeExternalContext.java:207)
              at com.icesoft.faces.context.View.switchToPushMode(View.java:142)
              at
      com.icesoft.faces.webapp.http.core.MultiViewServer.service(MultiViewServer.java:57)
              at
      com.icesoft.faces.webapp.http.common.standard.PathDispatcherServer$Matcher.serviceOnMatch(PathDispatcherServer.java:50)
              at
      com.icesoft.faces.webapp.http.common.standard.PathDispatcherServer.service(PathDispatcherServer.java:19)
              at
      com.icesoft.faces.webapp.http.servlet.ThreadBlockingAdaptingServlet.service(ThreadBlockingAdaptingServlet.java:19)
              at
      com.icesoft.faces.webapp.http.servlet.EnvironmentAdaptingServlet.service(EnvironmentAdaptingServlet.java:29)
              at
      com.icesoft.faces.webapp.http.servlet.MainSessionBoundServlet.service(MainSessionBoundServlet.java:139)
              at
      com.icesoft.faces.webapp.http.servlet.SessionDispatcher.service(SessionDispatcher.java:35)
              at
      com.icesoft.faces.webapp.http.servlet.PathDispatcher$Matcher.serviceOnMatch(PathDispatcher.java:52)
              at
      com.icesoft.faces.webapp.http.servlet.PathDispatcher.service(PathDispatcher.java:29)
              at
      com.icesoft.faces.webapp.http.servlet.MainServlet.service(MainServlet.java:79)
              at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
              at
      org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
              at
      org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
              at
      org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:654)
              at
      org.apache.catalina.core.ApplicationDispatcher.doInclude(ApplicationDispatcher.java:557)
              at
      org.apache.catalina.core.ApplicationDispatcher.include(ApplicationDispatcher.java:481)
              at
      com.liferay.portlet.PortletRequestDispatcherImpl.include(PortletRequestDispatcherImpl.java:245)
              at
      com.liferay.portlet.PortletRequestDispatcherImpl.include(PortletRequestDispatcherImpl.java:87)
              at
      com.icesoft.faces.webapp.http.portlet.MainPortlet.doInclude(MainPortlet.java:122)
              at
      com.icesoft.faces.webapp.http.portlet.MainPortlet.doView(MainPortlet.java:55)
              at javax.portlet.GenericPortlet.doDispatch(GenericPortlet.java:235)
              at javax.portlet.GenericPortlet.render(GenericPortlet.java:163)
              at
      com.liferay.portal.kernel.servlet.PortletServlet.service(PortletServlet.java:102)
              at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
              at
      org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
              at
      org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
              at
      org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:654)
              at
      org.apache.catalina.core.ApplicationDispatcher.doInclude(ApplicationDispatcher.java:557)
              at
      org.apache.catalina.core.ApplicationDispatcher.include(ApplicationDispatcher.java:481)
              at com.liferay.portlet.CachePortlet._invoke(CachePortlet.java:408)
              at com.liferay.portlet.CachePortlet.render(CachePortlet.java:251)
              at
      org.apache.jsp.html.portal.render_005fportlet_jsp._jspService(render_005fportlet_jsp.java:1345)
              at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
              at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
              at
      org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:373)
              at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:336)
              at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:265)

        Activity

        Hide
        Mircea Toma added a comment -

        Copy entry set to avoid ConcurrentModificationException-s.

        Show
        Mircea Toma added a comment - Copy entry set to avoid ConcurrentModificationException-s.
        Hide
        Ken Fyten added a comment -

        Customer believes that the supplied initial fix is not comprehensive enough. They have submitted a suggested solution which I will attach (they are ICEfaces Contributor's so we can use their code, etc.).

        Show
        Ken Fyten added a comment - Customer believes that the supplied initial fix is not comprehensive enough. They have submitted a suggested solution which I will attach (they are ICEfaces Contributor's so we can use their code, etc.).
        Hide
        Ken Fyten added a comment -

        Comments from contributor:


        I have been able to fix the icefaces CMEs. Included in the attached icefacesMods.tar.gz file are the source files changed.

        Note that my changes are only good for JDK 1.5.

        What I've done is modified core/src/com/icesoft/faces/context/AbstractCopyingAttributeMap.java to extend ConcurrentHashMap instead of HashMap, and fixed the put and putAll methods to drop and remove keys with null values. With the exception of a contains method call for a key, this should be transparent to the rest of the Icefaces code.

        I can't recreate a CME after these changes.


        NOTE: To make this suitable for JDK 1.4 we will need to use the ConcurrentHashMap class from the JDK 1.4 Concurrent utils backport instead.

        Show
        Ken Fyten added a comment - Comments from contributor: I have been able to fix the icefaces CMEs. Included in the attached icefacesMods.tar.gz file are the source files changed. Note that my changes are only good for JDK 1.5. What I've done is modified core/src/com/icesoft/faces/context/AbstractCopyingAttributeMap.java to extend ConcurrentHashMap instead of HashMap, and fixed the put and putAll methods to drop and remove keys with null values. With the exception of a contains method call for a key, this should be transparent to the rest of the Icefaces code. I can't recreate a CME after these changes. NOTE: To make this suitable for JDK 1.4 we will need to use the ConcurrentHashMap class from the JDK 1.4 Concurrent utils backport instead.
        Hide
        Mircea Toma added a comment -

        Synchronize request attribute map since its content is updated continuously by the framework.

        Show
        Mircea Toma added a comment - Synchronize request attribute map since its content is updated continuously by the framework.
        Hide
        Deryk Sinotte added a comment -

        The customer is concerned that the fix we applied does not solve the problem they are seeing. We need to review the fix in light of the customer's latest request.

        Show
        Deryk Sinotte added a comment - The customer is concerned that the fix we applied does not solve the problem they are seeing. We need to review the fix in light of the customer's latest request.
        Hide
        Mircea Toma added a comment -

        Resolving issue until the proof to the contrary.

        Show
        Mircea Toma added a comment - Resolving issue until the proof to the contrary.

          People

          • Assignee:
            Unassigned
            Reporter:
            Tyler Johnson
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: