ICEfaces
  1. ICEfaces
  2. ICE-2244

AuctionMonitor with multiple open views fails with ConcurrentModificationException

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 1.7DR#1
    • Fix Version/s: 1.7RC1, 1.7
    • Component/s: None
    • Labels:
      None
    • Environment:
      Jboss 4.2.1 GA, Tomcat 6.0.14

      Description

      Run the auctionMonitor sample in JBoss 4.2.1 GA server (or Tomcat 6.0.14) and open 2 or more browsers viewing the application. Communicate with each other via bidding or chat. While switching windows from one to another, the inactive windows frequently pops up internal error message and request a reload. After reloading, the application can still work but the problem repeatedly happens along the communication.

      The following is the exception captured from jboss log:

      7:22:52,103 ERROR [[/auctionMonitor]] Exception sending request destroyed lifec
      ycle event to listener instance of class com.sun.faces.application.WebappLifecyc
      leListener
      java.util.ConcurrentModificationException
             at java.util.HashMap$HashIterator.nextEntry(HashMap.java:841)
             at java.util.HashMap$KeyIterator.next(HashMap.java:877)
             at org.apache.catalina.util.Enumerator.<init>(Enumerator.java:101)
             at org.apache.catalina.util.Enumerator.<init>(Enumerator.java:67)
             at org.apache.catalina.connector.Request.getAttributeNames(Request.java:
      929)
             at org.apache.catalina.connector.RequestFacade.getAttributeNames(Request
      Facade.java:278)
             at com.sun.faces.application.WebappLifecycleListener.requestDestroyed(We
      bappLifecycleListener.java:76)
             at org.apache.catalina.core.StandardContextValve.invoke(StandardContextV
      alve.java:188)
             at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(Securit
      yAssociationValve.java:179)
             at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValv
      e.java:84)
             at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.j
      ava:128)
             at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.j
      ava:104)
             at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedC
      onnectionValve.java:157)
             at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineVal
      ve.java:109)
             at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.jav
      a:241)
             at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java
      :844)
             at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.proce
      ss(Http11Protocol.java:580)
             at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:44
      7)
             at java.lang.Thread.run(Thread.java:595)
      17:22:52,150 INFO [ClockBean] Disposing ClockBean for a user - cleaning up

        Activity

        Hide
        Ken Fyten added a comment -

        This appears to be a Tomcat bug as there is no ICEfaces code involved in the call chain.

        Show
        Ken Fyten added a comment - This appears to be a Tomcat bug as there is no ICEfaces code involved in the call chain.
        Hide
        Deryk Sinotte added a comment -

        Adding a reference to the forum. There are actually two separate forum entries:

        http://www.icefaces.org/JForum/posts/list/6028.page
        http://www.icefaces.org/JForum/posts/list/0/6194.page

        Even though there is no ICEfaces code in the stacktrace, it might be possible that, due to the way we do long-lived requests, we could be hanging on to something in the actual request rather than a copy. I see that it's a "requestDestroyed" event that's causing the problem in for the clients. This isn't an event that is specified in the spec but if Tomcat 6 is doing something extra with the requests to clean them up, we may not have encountered it much before. Since concurrent modification is a thread contention issue, it wouldn't show up reliably.

        Show
        Deryk Sinotte added a comment - Adding a reference to the forum. There are actually two separate forum entries: http://www.icefaces.org/JForum/posts/list/6028.page http://www.icefaces.org/JForum/posts/list/0/6194.page Even though there is no ICEfaces code in the stacktrace, it might be possible that, due to the way we do long-lived requests, we could be hanging on to something in the actual request rather than a copy. I see that it's a "requestDestroyed" event that's causing the problem in for the clients. This isn't an event that is specified in the spec but if Tomcat 6 is doing something extra with the requests to clean them up, we may not have encountered it much before. Since concurrent modification is a thread contention issue, it wouldn't show up reliably.
        Hide
        Ted Goddard added a comment -

        I'm occasionally seeing this exception in WebMC with 1.7DR3 trunk:

        java.util.ConcurrentModificationException
        at java.util.HashMap$HashIterator.nextEntry(HashMap.java:841)
        at java.util.HashMap$ValueIterator.next(HashMap.java:871)
        at java.util.AbstractCollection.toArray(AbstractCollection.java:176)
        at java.util.ArrayList.<init>(ArrayList.java:136)
        at com.icesoft.faces.webapp.http.core.DisposeBeans.in(DisposeBeans.java:32)
        at com.icesoft.faces.context.BridgeExternalContext.dispose(BridgeExternalContext.java:246)
        at com.icesoft.faces.context.View$6.servlet(View.java:109)
        at com.icesoft.faces.webapp.http.servlet.ServletRequestResponse.detectEnvironment(ServletRequestResponse.java:219)
        at com.icesoft.faces.context.View.updateOnPageRequest(View.java:105)
        at com.icesoft.faces.webapp.http.core.MultiViewServer.service(MultiViewServer.java:46)
        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:122)
        at com.icesoft.faces.webapp.http.servlet.SessionDispatcher.service(SessionDispatcher.java:37)
        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:76)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:831)
        at org.apache.catalina.core.ApplicationFilterChain.servletService(ApplicationFilterChain.java:411)
        at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:290)
        at org.apache.catalina.core.StandardContextValve.invokeInternal(StandardContextValve.java:271)
        at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:202)
        at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:632)
        at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:577)
        at com.sun.enterprise.web.WebPipeline.invoke(WebPipeline.java:94)
        at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:206)
        at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:632)
        at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:577)
        at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:571)
        at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:1080)
        at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:150)
        at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:632)
        at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:577)
        at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:571)
        at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:1080)
        at org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:272)
        at com.sun.enterprise.web.connector.grizzly.DefaultProcessorTask.invokeAdapter(DefaultProcessorTask.java:637)
        at com.sun.enterprise.web.connector.grizzly.comet.CometEngine.executeServlet(CometEngine.java:547)
        at com.sun.enterprise.web.connector.grizzly.comet.CometEngine.handle(CometEngine.java:299)
        at com.sun.enterprise.web.connector.grizzly.comet.CometAsyncFilter.doFilter(CometAsyncFilter.java:87)
        at com.sun.enterprise.web.connector.grizzly.async.DefaultAsyncExecutor.invokeFilters(DefaultAsyncExecutor.java:175)
        at com.sun.enterprise.web.connector.grizzly.async.DefaultAsyncExecutor.interrupt(DefaultAsyncExecutor.java:153)
        at com.sun.enterprise.web.connector.grizzly.async.AsyncProcessorTask.doTask(AsyncProcessorTask.java:92)
        at com.sun.enterprise.web.connector.grizzly.TaskBase.run(TaskBase.java:265)
        at com.sun.enterprise.web.connector.grizzly.WorkerThreadImpl.run(WorkerThreadImpl.java:116)

        Show
        Ted Goddard added a comment - I'm occasionally seeing this exception in WebMC with 1.7DR3 trunk: java.util.ConcurrentModificationException at java.util.HashMap$HashIterator.nextEntry(HashMap.java:841) at java.util.HashMap$ValueIterator.next(HashMap.java:871) at java.util.AbstractCollection.toArray(AbstractCollection.java:176) at java.util.ArrayList.<init>(ArrayList.java:136) at com.icesoft.faces.webapp.http.core.DisposeBeans.in(DisposeBeans.java:32) at com.icesoft.faces.context.BridgeExternalContext.dispose(BridgeExternalContext.java:246) at com.icesoft.faces.context.View$6.servlet(View.java:109) at com.icesoft.faces.webapp.http.servlet.ServletRequestResponse.detectEnvironment(ServletRequestResponse.java:219) at com.icesoft.faces.context.View.updateOnPageRequest(View.java:105) at com.icesoft.faces.webapp.http.core.MultiViewServer.service(MultiViewServer.java:46) 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:122) at com.icesoft.faces.webapp.http.servlet.SessionDispatcher.service(SessionDispatcher.java:37) 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:76) at javax.servlet.http.HttpServlet.service(HttpServlet.java:831) at org.apache.catalina.core.ApplicationFilterChain.servletService(ApplicationFilterChain.java:411) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:290) at org.apache.catalina.core.StandardContextValve.invokeInternal(StandardContextValve.java:271) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:202) at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:632) at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:577) at com.sun.enterprise.web.WebPipeline.invoke(WebPipeline.java:94) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:206) at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:632) at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:577) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:571) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:1080) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:150) at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:632) at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:577) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:571) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:1080) at org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:272) at com.sun.enterprise.web.connector.grizzly.DefaultProcessorTask.invokeAdapter(DefaultProcessorTask.java:637) at com.sun.enterprise.web.connector.grizzly.comet.CometEngine.executeServlet(CometEngine.java:547) at com.sun.enterprise.web.connector.grizzly.comet.CometEngine.handle(CometEngine.java:299) at com.sun.enterprise.web.connector.grizzly.comet.CometAsyncFilter.doFilter(CometAsyncFilter.java:87) at com.sun.enterprise.web.connector.grizzly.async.DefaultAsyncExecutor.invokeFilters(DefaultAsyncExecutor.java:175) at com.sun.enterprise.web.connector.grizzly.async.DefaultAsyncExecutor.interrupt(DefaultAsyncExecutor.java:153) at com.sun.enterprise.web.connector.grizzly.async.AsyncProcessorTask.doTask(AsyncProcessorTask.java:92) at com.sun.enterprise.web.connector.grizzly.TaskBase.run(TaskBase.java:265) at com.sun.enterprise.web.connector.grizzly.WorkerThreadImpl.run(WorkerThreadImpl.java:116)
        Hide
        Ken Fyten added a comment -

        Can't reproduce this issue with 1.7. Marking fixed.

        Show
        Ken Fyten added a comment - Can't reproduce this issue with 1.7. Marking fixed.

          People

          • Assignee:
            Unassigned
            Reporter:
            Ken Fyten
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: