aspose file tools*
The moose likes Servlets and the fly likes Exception with the available Buffer Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "Exception with the available Buffer" Watch "Exception with the available Buffer" New topic
Author

Exception with the available Buffer

Shankar Ganesh
Ranch Hand

Joined: Oct 01, 2000
Posts: 34
I have a JSP which access a big collection (it has about 250 objects, containing 2 Strings attributes each). After this collection, the JSP accesses few other collections (very small ones).
I get the below Buffer error while trying to access these small collections at the end of the page.
Can someone please suggest how to fix this?
<h1>Error: 500</h1>
<b>Internal Servlet Error:</b><br>
<pre>
javax.servlet.ServletException: Error: Attempt to clear a buffer that's already been flushed
at org.apache.jasper.runtime.JspServlet.service(JspServlet.java, Compiled Code)
at javax.servlet.http.HttpServlet.service(HttpServlet.java, Compiled Code)
at org.apache.tomcat.core.ServiceInvocationHandler.method(ServletWrapper.java, Compiled Code)
at org.apache.tomcat.core.ServletWrapper.handleInvocation(ServletWrapper.java, Compiled Code)
at org.apache.tomcat.core.ServletWrapper.handleRequest(ServletWrapper.java, Compiled Code)
at org.apache.tomcat.core.RequestDispatcherImpl.forward(RequestDispatcherImpl.java, Compiled Code)
at com.ge.appl.tsf.shells.web.TSFUrlHandler.forward(TSFUrlHandler.java, Compiled Code)
at com.ge.appl.tsf.shells.web.TSFWebPresentationManager.render(TSFWebPresentationManager.java, Compiled Code)
at com.ge.appl.tsf.shells.web.TSFDispatcher.service(TSFDispatcher.java, Compiled Code)
at javax.servlet.http.HttpServlet.service(HttpServlet.java, Compiled Code)
at org.apache.tomcat.core.ServiceInvocationHandler.method(ServletWrapper.java, Compiled Code)
at org.apache.tomcat.core.ServletWrapper.handleInvocation(ServletWrapper.java, Compiled Code)
at org.apache.tomcat.core.ServletWrapper.handleRequest(ServletWrapper.java, Compiled Code)
at org.apache.tomcat.core.Context.handleRequest(Context.java, Compiled Code)
at org.enhydra.servlet.servletManager.ServletManager.service(ServletManager.java, Compiled Code)
at org.enhydra.servlet.connectionMethods.http.HttpHandler.doARequest(HttpHandler.java, Compiled Code)
at org.enhydra.servlet.connectionMethods.http.HttpHandler.processRequests(HttpHandler.java, Compiled Code)
at org.enhydra.servlet.connectionMethods.http.HttpHandler.run(HttpHandler.java, Compiled Code)
at java.lang.Thread.run(Thread.java, Compiled Code)
</pre>
<b>Root cause:</b>
<pre>
java.io.IOException: Error: Attempt to clear a buffer that's already been flushed
at org.apache.jasper.runtime.JspWriterImpl.clear(JspWriterImpl.java, Compiled Code)
at jsp.temp._0002fjsp_0002ftemp_0002fadmin_0002ejspadmin_jsp_1._jspService(_0002fjsp_0002ftemp_0002fadmin_0002ejspadmin_jsp_1.java, Compiled Code)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java, Compiled Code)
at javax.servlet.http.HttpServlet.service(HttpServlet.java, Compiled Code)
at org.apache.jasper.runtime.JspServlet$JspServletWrapper.service(JspServlet.java, Compiled Code)
at org.apache.jasper.runtime.JspServlet.serviceJspFile(JspServlet.java, Compiled Code)
at org.apache.jasper.runtime.JspServlet.service(JspServlet.java, Compiled Code)
at javax.servlet.http.HttpServlet.service(HttpServlet.java, Compiled Code)
at org.apache.tomcat.core.ServiceInvocationHandler.method(ServletWrapper.java, Compiled Code)
at org.apache.tomcat.core.ServletWrapper.handleInvocation(ServletWrapper.java, Compiled Code)
at org.apache.tomcat.core.ServletWrapper.handleRequest(ServletWrapper.java, Compiled Code)
at org.apache.tomcat.core.RequestDispatcherImpl.forward(RequestDispatcherImpl.java, Compiled Code)
at com.ge.appl.tsf.shells.web.TSFUrlHandler.forward(TSFUrlHandler.java, Compiled Code)
at com.ge.appl.tsf.shells.web.TSFWebPresentationManager.render(TSFWebPresentationManager.java, Compiled Code)
at com.ge.appl.tsf.shells.web.TSFDispatcher.service(TSFDispatcher.java, Compiled Code)
at javax.servlet.http.HttpServlet.service(HttpServlet.java, Compiled Code)
at org.apache.tomcat.core.ServiceInvocationHandler.method(ServletWrapper.java, Compiled Code)
at org.apache.tomcat.core.ServletWrapper.handleInvocation(ServletWrapper.java, Compiled Code)
at org.apache.tomcat.core.ServletWrapper.handleRequest(ServletWrapper.java, Compiled Code)
at org.apache.tomcat.core.Context.handleRequest(Context.java, Compiled Code)
at org.enhydra.servlet.servletManager.ServletManager.service(ServletManager.java, Compiled Code)
at org.enhydra.servlet.connectionMethods.http.HttpHandler.doARequest(HttpHandler.java, Compiled Code)
at org.enhydra.servlet.connectionMethods.http.HttpHandler.processRequests(HttpHandler.java, Compiled Code)
at org.enhydra.servlet.connectionMethods.http.HttpHandler.run(HttpHandler.java, Compiled Code)
at java.lang.Thread.run(Thread.java, Compiled Code)
</pre>
Mahesh Eshwarappa
Greenhorn

Joined: Jan 04, 2001
Posts: 28
Hi,
You can try this out and check if it works in u r JSP.
<% page buffer="14kb"%>

You can change the buffering size for a Jsp.Default is 8kb.
I haven't tried.
Give it a try
Mahesh
Originally posted by Shankar Ganesh:
[B]I have a JSP which access a big collection (it has about 250 objects, containing 2 Strings attributes each). After this collection, the JSP accesses few other collections (very small ones).
I get the below Buffer error while trying to access these small collections at the end of the page.
Mahesh Eshwarappa
Greenhorn

Joined: Jan 04, 2001
Posts: 28
Am sorry,

Its <%@ page buffer="14kb"%>
Shankar Ganesh
Ranch Hand

Joined: Oct 01, 2000
Posts: 34
Should this be placed in any specific part of the JSP?
Shankar Ganesh
Ranch Hand

Joined: Oct 01, 2000
Posts: 34
Oops! At first glance, didn't realize it's just a page directive. Ignore the previous message.
Thanks for the response... Adding the bigger buffer size did fix the problem.
- Shankar.
Originally posted by Shankar Ganesh:
Should this be placed in any specific part of the JSP?

 
Consider Paul's rocket mass heater.
 
subject: Exception with the available Buffer