I too have now seen this exact exception. Its a hard 
one to reproduce, but we think it has something 
to do with, in our case, cookie size growing too 
big for our default settings. Regardless of cause, this code:


 // Let's read all form parameters
        while (readNext) {
            try {
                param = readNextParameter();

                if (param != null) {
                    // Add parsed parameter to the form
                    form.add(param);
                } else {
                    // Last parameter parsed
                    readNext = false;
                }
            } catch (IOException ioe) {
                getLogger().log(Level.WARNING,
                        "Unable to parse a form parameter. 
Skipping it.", ioe);
            }
        }

the issue is that it uses readNext which is set to 'true' before
beginning, and the readNextParameter() method throwing an 
IOException when the underlying stream is closed for any reason.
 So the sequence is:

- readNext boolean value is set to 'true'
- readNextParameter tries to call stream.read()
- underlying stream is closed
- readNextParameter throws an IOException saying 'stream is closed'
- this IOException is caught before having the ability to break out 
of 'while loop'
- 'readNext' is still 'true'
- readNextParameter is called again
- IOException is caught by 'catch' block
- stream is closed.... exception, loop, loop, etc.


perhaps we should either scope the try/catch outside of the scope 
of the 'while' block, or, the 'catch' block should 
make 'readNext' false. This will break it out of this infinite loop.


Sean            

Reply via email to