Message: A new issue has been created in JIRA.
--------------------------------------------------------------------- View the issue: http://issues.apache.org/jira/browse/JS2-17 Here is an overview of the issue: --------------------------------------------------------------------- Key: JS2-17 Summary: ava.util.ConcurrentModificationException during parallel Portlet rendering Type: Bug Status: Unassigned Priority: Major Project: Jetspeed 2 Components: Container Versions: 2.0-dev/cvs Assignee: Reporter: Ate Douma Created: Wed, 21 Apr 2004 5:15 AM Updated: Wed, 21 Apr 2004 5:15 AM Environment: WindowsXP, J2SE1.4.2_03, Tomcat 4.1.29 Description: I now have encountered this exception multiple times so I dived into it what was going on here. It turns out that the parallel rendering of portlets isn't thread save. When the rendering of a portlet is dispatched through Tomcat by o.a.j.container.invoker.ServletPortletInvoker.invoke Tomcat will create its own wrappers around the supplied request and response parameters. While doing that, it retrieves the attributes from the request which are stored in a HashMap. But, as this HashMap is seemingly shared by all portlets (from the base request probably) this CAN lead to thread unsave situations with parallel rendering and I've encountered this now rather often. A don't have a clear solution right now but what maybe could help is ensuring that the already request wrapper passed on to Tomcat for rendering doesn't fall back on shared Maps for its attributes (and parameters probably). So, for each portlet a separate wrapped request is needed which has its own HashMap of attributes and parameters. Most likely then this won't break anymore. Warning: I've seen in parts of the request handling code of Catalina (Tomcat 4) that it unwraps request objects until it finds the original one created by Catalina itself. If that's been done here as well no real protection against this problem can be created and the parallel rendering is in trouble. An example snippet including stacktrace of the exception from jetspeed.log: 2004-04-20 11:32:48,328 [WORKER_13] DEBUG org.apache.jetspeed.aggregator.impl.Worker - Processing job for window :15 2004-04-20 11:32:48,328 [WORKER_13] DEBUG org.apache.jetspeed.aggregator.impl.RenderingJob - Rendering OID 15 [EMAIL PROTECTED] [EMAIL PROTECTED] 2004-04-20 11:32:48,328 [WORKER_13] ERROR org.apache.jetspeed.container.invoker.ServletPortletInvoker - Failed to dispatch.include for Portlet Application: /struts-demo, servlet: /container java.util.ConcurrentModificationException at java.util.HashMap$HashIterator.nextEntry(HashMap.java:782) at java.util.HashMap$KeyIterator.next(HashMap.java:818) at org.apache.catalina.util.Enumerator.nextElement(Enumerator.java:217) at org.apache.catalina.core.ApplicationHttpRequest.setRequest(ApplicationHttpRequest.java:514) at org.apache.catalina.core.ApplicationHttpRequest.<init>(ApplicationHttpRequest.java:125) at org.apache.catalina.core.ApplicationDispatcher.wrapRequest(ApplicationDispatcher.java:921) at org.apache.catalina.core.ApplicationDispatcher.doInclude(ApplicationDispatcher.java:547) at org.apache.catalina.core.ApplicationDispatcher.include(ApplicationDispatcher.java:498) at org.apache.jetspeed.container.invoker.ServletPortletInvoker.invoke(ServletPortletInvoker.java:208) at org.apache.jetspeed.container.invoker.ServletPortletInvoker.render(ServletPortletInvoker.java:122) at org.apache.pluto.PortletContainerImpl.renderPortlet(PortletContainerImpl.java:107) at org.apache.jetspeed.container.JetspeedPortletContainerWrapper.renderPortlet(JetspeedPortletContainerWrapper.java:98) at org.apache.jetspeed.aggregator.impl.RenderingJob.run(RenderingJob.java:109) at org.apache.jetspeed.aggregator.impl.Worker.run(Worker.java:142) 2004-04-20 11:32:48,328 [WORKER_13] ERROR org.apache.jetspeed.aggregator.impl.RenderingJob - Error rendering portlet OID 15 javax.portlet.PortletException: Failed to dispatch.include for Portlet Application: /struts-demo, servlet: /container at org.apache.jetspeed.container.invoker.ServletPortletInvoker.invoke(ServletPortletInvoker.java:215) at org.apache.jetspeed.container.invoker.ServletPortletInvoker.render(ServletPortletInvoker.java:122) at org.apache.pluto.PortletContainerImpl.renderPortlet(PortletContainerImpl.java:107) at org.apache.jetspeed.container.JetspeedPortletContainerWrapper.renderPortlet(JetspeedPortletContainerWrapper.java:98) at org.apache.jetspeed.aggregator.impl.RenderingJob.run(RenderingJob.java:109) at org.apache.jetspeed.aggregator.impl.Worker.run(Worker.java:142) Caused by: java.util.ConcurrentModificationException at java.util.HashMap$HashIterator.nextEntry(HashMap.java:782) at java.util.HashMap$KeyIterator.next(HashMap.java:818) at org.apache.catalina.util.Enumerator.nextElement(Enumerator.java:217) at org.apache.catalina.core.ApplicationHttpRequest.setRequest(ApplicationHttpRequest.java:514) at org.apache.catalina.core.ApplicationHttpRequest.<init>(ApplicationHttpRequest.java:125) at org.apache.catalina.core.ApplicationDispatcher.wrapRequest(ApplicationDispatcher.java:921) at org.apache.catalina.core.ApplicationDispatcher.doInclude(ApplicationDispatcher.java:547) at org.apache.catalina.core.ApplicationDispatcher.include(ApplicationDispatcher.java:498) at org.apache.jetspeed.container.invoker.ServletPortletInvoker.invoke(ServletPortletInvoker.java:208) ... 5 more Nested Exception is java.util.ConcurrentModificationException at java.util.HashMap$HashIterator.nextEntry(HashMap.java:782) at java.util.HashMap$KeyIterator.next(HashMap.java:818) at org.apache.catalina.util.Enumerator.nextElement(Enumerator.java:217) at org.apache.catalina.core.ApplicationHttpRequest.setRequest(ApplicationHttpRequest.java:514) at org.apache.catalina.core.ApplicationHttpRequest.<init>(ApplicationHttpRequest.java:125) at org.apache.catalina.core.ApplicationDispatcher.wrapRequest(ApplicationDispatcher.java:921) at org.apache.catalina.core.ApplicationDispatcher.doInclude(ApplicationDispatcher.java:547) at org.apache.catalina.core.ApplicationDispatcher.include(ApplicationDispatcher.java:498) at org.apache.jetspeed.container.invoker.ServletPortletInvoker.invoke(ServletPortletInvoker.java:208) at org.apache.jetspeed.container.invoker.ServletPortletInvoker.render(ServletPortletInvoker.java:122) at org.apache.pluto.PortletContainerImpl.renderPortlet(PortletContainerImpl.java:107) at org.apache.jetspeed.container.JetspeedPortletContainerWrapper.renderPortlet(JetspeedPortletContainerWrapper.java:98) at org.apache.jetspeed.aggregator.impl.RenderingJob.run(RenderingJob.java:109) at org.apache.jetspeed.aggregator.impl.Worker.run(Worker.java:142) 2004-04-20 11:32:48,328 [WORKER_13] DEBUG org.apache.jetspeed.aggregator.impl.ContentDispatcherImpl - Notifying complete OID 15 --------------------------------------------------------------------- JIRA INFORMATION: This message is automatically generated by JIRA. If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa If you want more information on JIRA, or have a bug to report see: http://www.atlassian.com/software/jira --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
