• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Tim Cooke
  • Devaka Cooray
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Rob Spoor
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Piet Souris
  • Mikalai Zaikin
Bartenders:
  • Carey Brown
  • Roland Mueller

Exception with the available Buffer

 
Ranch Hand
Posts: 34
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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>
 
Greenhorn
Posts: 28
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 28
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Am sorry,

Its <%@ page buffer="14kb"%>
 
Shankar Ganesh
Ranch Hand
Posts: 34
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Should this be placed in any specific part of the JSP?
 
Shankar Ganesh
Ranch Hand
Posts: 34
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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?


 
my overalls have superpowers - they repel people who think fashion is important. Tiny ad:
We need your help - Coderanch server fundraiser
https://coderanch.com/wiki/782867/Coderanch-server-fundraiser
reply
    Bookmark Topic Watch Topic
  • New Topic