I am writting an application in javabeans and jsp. When I run the application I have some output and the internal servlet error: "attempt to clear a buffer that is already been flushed". My application is running under Tomcat 3.2.2.

Alessandro A. Garbagnati

The error it's easy to explain. The servlet (or jsp that's the same thing) uses a buffer to write the output that will be sent to the client. Once the buffer it's full, the servlet container sends it out, and then clears it allowing the servlet to go on in writing.

That error message comes out when the code encounter a clearBuffer() method. If the buffer has been already flushed, you will get that error (or an IllegalStateException).

The easiest solution of the problem is to change the size of the buffer. This can be done using a <%@ page ... > directive or, through the setBufferSize() in a servlet code.