tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 6617] New: - Iterating over session attribute name enumeration fails with a ConcurrentModificationException on org.apache.catalina.util.Enumerator.nextElement(Enumerator.java:166);
Date Thu, 21 Feb 2002 17:42:10 GMT
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=6617>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=6617

Iterating over session attribute name enumeration fails with a ConcurrentModificationException
on org.apache.catalina.util.Enumerator.nextElement(Enumerator.java:166);

           Summary: Iterating over session attribute name enumeration fails
                    with a ConcurrentModificationException on
                    org.apache.catalina.util.Enumerator.nextElement(Enumerat
                    or.java:166);
           Product: Tomcat 4
           Version: 4.0.1 Final
          Platform: All
        OS/Version: Other
            Status: NEW
          Severity: Critical
          Priority: Other
         Component: Catalina
        AssignedTo: tomcat-dev@jakarta.apache.org
        ReportedBy: kevin.ross@bredex.com


Attempting to clean up the session by iterating over the enumeration of 
attribute names fails with a ConcurrentModificationException on 
org.apache.catalina.util.Enumerator.nextElement(Enumerator.java:166);

=========CODE=====================================

Enumeration enumeration = session.getAttributeNames();

System.out.println("Enum: " + enumeration);
while(enumeration.hasMoreElements()) {

    String name = null;
    try{
        name = (String)enumeration.nextElement();
    }
    catch(Throwable t){


        System.out.println("Caught Throwable while getting next element from 
enumeration. name: " + name);
        t.printStackTrace();
        break;
    }

    System.out.println("Attempting to remove from enumeration: " + name);
    session.removeAttribute(name);
    System.out.println("Done removing from enumeration: " + name + ".");
}



=========LOG======================================
Cleaning up the session...
Enumeration: org.apache.catalina.util.Enumerator@f2225f
Attempting to remove from enumeration: mk
Done removing from enumeration: mk.
Caught Throwable while getting next element from enumeration. name: null
java.util.ConcurrentModificationException
        at java.util.HashMap$HashIterator.nextEntry(HashMap.java:750)
        at java.util.HashMap$KeyIterator.next(HashMap.java:786)
        at org.apache.catalina.util.Enumerator.nextElement(Enumerator.java:166)
        at com.bredex.servlet.Login.service(Login.java:113)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter
(ApplicationFilterChain.java:247)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter
(ApplicationFilterChain.java:193)
        at org.apache.catalina.core.StandardWrapperValve.invoke
(StandardWrapperValve.java:243)
        at org.apache.catalina.core.StandardPipeline.invokeNext
(StandardPipeline.java:566)
        at org.apache.catalina.core.StandardPipeline.invoke
(StandardPipeline.java:472)
        at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
        at org.apache.catalina.core.StandardContextValve.invoke
(StandardContextValve.java:201)
        at org.apache.catalina.core.StandardPipeline.invokeNext
(StandardPipeline.java:566)
        at org.apache.catalina.valves.CertificatesValve.invoke
(CertificatesValve.java:246)
        at org.apache.catalina.core.StandardPipeline.invokeNext
(StandardPipeline.java:564)
        at org.apache.catalina.core.StandardPipeline.invoke
(StandardPipeline.java:472)
        at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
        at org.apache.catalina.core.StandardContext.invoke
(StandardContext.java:2344)
        at org.apache.catalina.core.StandardHostValve.invoke
(StandardHostValve.java:164)
        at org.apache.catalina.core.StandardPipeline.invokeNext
(StandardPipeline.java:566)
        at org.apache.catalina.valves.ErrorDispatcherValve.invoke
(ErrorDispatcherValve.java:170)
        at org.apache.catalina.core.StandardPipeline.invokeNext
(StandardPipeline.java:564)
        at org.apache.catalina.valves.ErrorReportValve.invoke
(ErrorReportValve.java:170)
        at org.apache.catalina.core.StandardPipeline.invokeNext
(StandardPipeline.java:564)
        at org.apache.catalina.valves.AccessLogValve.invoke
(AccessLogValve.java:462)
        at org.apache.catalina.core.StandardPipeline.invokeNext
(StandardPipeline.java:564)
        at org.apache.catalina.core.StandardPipeline.invoke
(StandardPipeline.java:472)
        at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
        at org.apache.catalina.core.StandardEngineValve.invoke
(StandardEngineValve.java:163)
        at org.apache.catalina.core.StandardPipeline.invokeNext
(StandardPipeline.java:566)
        at org.apache.catalina.core.StandardPipeline.invoke
(StandardPipeline.java:472)
        at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
        at org.apache.catalina.connector.http.HttpProcessor.process
(HttpProcessor.java:1011)
        at org.apache.catalina.connector.http.HttpProcessor.run
(HttpProcessor.java:1106)
        at java.lang.Thread.run(Thread.java:536)

--
To unsubscribe, e-mail:   <mailto:tomcat-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:tomcat-dev-help@jakarta.apache.org>


Mime
View raw message