You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Dennis Muhlestein <de...@zserve.com> on 2003/04/15 16:33:35 UTC

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(McastMembership.java:52)
         at 
org.apache.catalina.cluster.mcast.McastServiceImpl.receive(McastServiceImpl.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


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

Posted by Jacob Kjome <ho...@visi.com>.
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

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

Posted by Filip Hanik <ma...@filip.net>.
this log entry means that a nodewas added to the cluster, in this case
10.1.1.13 listening on port 4001.

if this happens during the middle of your run, I suggest that you increase
the drop time,
hence the member has been considered dead and is now added again

Filip

> -----Original Message-----
> From: Dennis Muhlestein [mailto:dennis@zserve.com]
> Sent: Tuesday, April 15, 2003 11:30 AM
> To: tomcat-user@jakarta.apache.org
> Subject: Re: tomct-replication Exception:
> java.util.ConcurrentModificationException
>
>
> In addition to the original exception.  We also get this:
>
> ==> logs/localhost_log.2003-04-15.txt <==
> 2003-04-15 10:49:08 StandardManager[]: [InMemoryReplicationManager]
> Replication member
> added:org.apache.catalina.cluster.mcast.McastMember[tcp://10.1.1.1
> 3:4001,10.1.1.13,4001]
>
> I think the replication unit is suffering when this excpetion occurs.
> We have had some users complaining of their session being timed out.
>
> -Thanks
>
>
> 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
>
>


---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org


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

Posted by Dennis Muhlestein <de...@zserve.com>.
In addition to the original exception.  We also get this:

==> logs/localhost_log.2003-04-15.txt <==
2003-04-15 10:49:08 StandardManager[]: [InMemoryReplicationManager]
Replication member
added:org.apache.catalina.cluster.mcast.McastMember[tcp://10.1.1.13:4001,10.1.1.13,4001]

I think the replication unit is suffering when this excpetion occurs.
We have had some users complaining of their session being timed out.

-Thanks


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


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

Posted by Filip Hanik <ma...@filip.net>.
hi Dennis and others,
yes, we have seen this before, and it has been fixed in the version
published on the website

http://cvs.apache.org/~fhanik/

let me know if you still have problems

Filip

> -----Original Message-----
> From: Dennis Muhlestein [mailto:dennis@zserve.com]
> Sent: Tuesday, April 15, 2003 9:34 AM
> To: tomcat-user@jakarta.apache.org
> Subject: Re: tomct-replication Exception:
> java.util.ConcurrentModificationException
>
>
> 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
>
>


---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org


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

Posted by Dennis Muhlestein <de...@zserve.com>.
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


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

Posted by Andy Eastham <an...@gliant.com>.
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