You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Jacob Kjome <ho...@visi.com> on 2003/04/15 20:20:21 UTC

Re: tomct-replication Exception: java.util.ConcurrentModificationException

Looks to me like the replication code needs to create a thread safe Map 
using something like...

Map synchedMap = Collections.synchronizedMap(new HashMap());

Jake

At 10:34 AM 4/15/2003 -0600, you wrote:
>Thank you for the response.  I guess my point in posting this, is that the 
>exception occurs in the tomcat-replication code, not in my code.
>Was wondering if Filip had come accross anything like this.
>
>-Dennis
>
>Andy Eastham wrote:
>
>>Dennis,
>>
>>This is a feature of the collections framework.  If you create an iterator
>>on a collection, then modify the underlying collection object, you get this
>>exception.
>>
>>I've had it when I've mistakenly used an iterator to loop over a collection
>>and tried to delete an object from the underling  collection.  Sometimes you
>>can perform the operation on the iterator itself to avoid this.
>>
>>You should be able to redesign the code to avoid it, once you know why it's
>>occurring.
>>
>>Andy
>>
>>
>>
>>>-----Original Message-----
>>>From: Dennis Muhlestein [mailto:dennis@zserve.com]
>>>Sent: 15 April 2003 15:34
>>>To: tomcat-user@jakarta.apache.org
>>>Subject: tomct-replication Exception:
>>>java.util.ConcurrentModificationException
>>>
>>>
>>>We get this exception in our catalina.out file fairly often.  Any
>>>suggestions?
>>>
>>>java.util.ConcurrentModificationException
>>>         at java.util.HashMap$HashIterator.nextEntry(HashMap.java:762)
>>>         at java.util.HashMap$KeyIterator.next(HashMap.java:798)
>>>         at
>>>org.apache.catalina.cluster.mcast.McastMembership.expire(McastMemb
>>>ership.java:52)
>>>         at
>>>org.apache.catalina.cluster.mcast.McastServiceImpl.receive(McastSe
>>>rviceImpl.java:116)
>>>         at
>>>org.apache.catalina.cluster.mcast.McastServiceImpl$ReceiverThread.
>>>run(McastServiceImpl.java:140)
>>>
>>>
>>>Using Filip's tomcat-replication.jar/tomcat 4.1.18/blackdown-jdk-1.4.1
>>>
>>>-Thanks
>>>Dennis
>>>
>>>
>>>---------------------------------------------------------------------
>>>To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
>>>For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
>>>
>>>
>>>
>>
>>
>>
>>
>>
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
>For additional commands, e-mail: tomcat-user-help@jakarta.apache.org