Win a copy of Microservices in Action this week in the Web Services forum!
  • 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 all forums
this forum made possible by our volunteer staff, including ...
  • Campbell Ritchie
  • Bear Bibeault
  • Devaka Cooray
  • Liutauras Vilda
  • Jeanne Boyarsky
  • Knute Snortum
  • Junilu Lacar
  • paul wheaton
Saloon Keepers:
  • Ganesh Patekar
  • Frits Walraven
  • Tim Moores
  • Ron McLeod
  • Carey Brown
  • Stephan van Hulst
  • salvin francis
  • Tim Holloway

Error flushing the output stream in Sun One server  RSS feed

Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,

I was running my servlet code in iPlanet 6.0 version and it was working fine. I upgraded my web server to new Sun One server (Oracle-iPlanet-Web-Server-7.0.9). With the new web server almost 90% of my application works fine, but there is a features in my application to download an Excel sheet by clicking a button. This feature is failing in new Sun One web server.

Below are my piece of code and the error log I m getting. Can anyone tell me how I can fix this error, I mean is there any web server specific change or configuration parameter need to be set.

Please ask for any information regarding my server configuration settings if needed for finding a solution for this


byte abyte0[] = new byte[1024];
BufferedInputStream bufferedinputstream=null;
BufferedOutputStream bufferedoutputstream=null; inputstream = httpurlconnection.getInputStream();
bufferedinputstream = new BufferedInputStream(inputstream);
bufferedoutputstream = new BufferedOutputStream(httpservletresponse.getOutputStream());

int j;
long byteCount=0;

while((j =, 0, 1024)) != -1)
if(logger != null && logger.traceOn())
logger.log("Read bytes:"+j);
bufferedoutputstream.write(abyte0, 0, j);
if(logger != null && logger.traceOn())
logger.log("Wrote bytes:"+j);

bufferedoutputstream.flush(); // <<<<<< ERROR POINT >>>>>>

Error Log :

ClientAbortException: WEB8004: Error flushing the output stream
at org.apache.coyote.tomcat5.OutputBuffer.doFlush(
at org.apache.coyote.tomcat5.OutputBuffer.flush(
at org.apache.coyote.tomcat5.CoyoteOutputStream.flush(
at javax.servlet.http.HttpServlet.service(
at javax.servlet.http.HttpServlet.service(
at org.apache.catalina.core.ApplicationFilterChain.servletService(
at org.apache.catalina.core.StandardWrapperValve.invoke(
at org.apache.catalina.core.StandardContextValve.invokeInternal(
at org.apache.catalina.core.StandardContextValve.invoke(
at org.apache.catalina.core.StandardPipeline.doInvoke(
at org.apache.catalina.core.StandardPipeline.invoke(
at org.apache.catalina.core.StandardHostValve.invoke(
at org.apache.catalina.core.StandardPipeline.doInvoke(
at org.apache.catalina.core.StandardPipeline.invoke(
at com.sun.webserver.connector.nsapi.NSAPIProcessor.service(
Caused by: WEB8004: Error flushing the output stream
at com.sun.webserver.connector.nsapi.NSAPIProcessor.action(
at org.apache.coyote.Response.action(
at org.apache.coyote.tomcat5.OutputBuffer.doFlush(
... 20 more
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!