On Mon, May 16, 2011 at 7:57 AM, antalk <[email protected]> wrote:
> Thanks for your message, i hope it is now clear that it indeed is a issue
> somewhere within Tapestry. As a matter of fact i didn't saw this message for
> a long time on our test machines. But just today i encountered the same
> issue again.

It looks like SessionImpl.getAttributeNames should be reworked to
synchronize on the session - or at least catch the
ConcurrentModificationException and try again (see patch below) which
is simpler.

But I worry that the same error could be thrown in the
getAttributeNames function on line 61, too - similar technique should
probably be used there as well.

--- SessionImpl.java~   2011-05-16 12:19:31.159348203 -0700
+++ SessionImpl.java    2011-05-16 12:28:35.073307235 -0700
@@ -72,8 +72,27 @@

     public List<String> getAttributeNames(String prefix)
     {
-        List<String> result = CollectionFactory.newList();
+        List<String> result = null;

+        do
+        {
+            try
+            {
+                result = getAttributeNamesFromSession(prefix);
+            }
+            catch (ConcurrentModificationException)
+            {
+                // Ignore - result will be null so we will try again
+            }
+        }
+        while (result == null);
+
+        return result;
+    }
+
+    private List<String> getAttributeNamesFromSession(String prefix)
throws ConcurrentModificationException
+    {
+        List<String> result = CollectionFactory.newList();
         Enumeration e = session.getAttributeNames();
         while (e.hasMoreElements())
         {

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to