struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From awc <...@drytel.net>
Subject ConcurrentModificationException in logoff
Date Thu, 27 Mar 2003 23:15:03 GMT
Hi All,

In log off action, I have code like this...

 Enumeration enum = session.getAttributeNames();
 while(enum.hasMoreElements())
 {
  String att = (String)enum.nextElement();
     session.removeAttribute( att );
   }
 session.invalidate();
 return (mapping.findForward(Constants.ROOT));

I guess I am taking off something struts need too. I get exception like
this...

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.util.Enumerator.nextElement(Enumerator.java:166)
        at ca.awcl.struts.user.LogoffAction.execute(Unknown Source)
        at
org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:480)

        at
org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:274)

        .........

If  I comment out

Enumeration enum = session.getAttributeNames();
 while(enum.hasMoreElements())
 {
  String att = (String)enum.nextElement();
     session.removeAttribute( att );
   }

I do not get the Exception....

any ideas... Or how do I log off tomcat-apache cleanly..

or is it good idea to just invalidate the session when you log off??

Thanks

.anil

This is on struts-1.1b3 with tomcat 4.1.18 with sun java-1.4.1_01_b01 on
Redhat Linux 7.3.





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


Mime
View raw message