aspose file tools*
The moose likes Other Java Products and Servers and the fly likes Error flushing the output stream in Sun One server Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Products » Other Java Products and Servers
Bookmark "Error flushing the output stream in Sun One server" Watch "Error flushing the output stream in Sun One server" New topic
Author

Error flushing the output stream in Sun One server

Sachidananda Pattnaik
Greenhorn

Joined: Nov 02, 2010
Posts: 9
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


Code:

byte abyte0[] = new byte[1024];
BufferedInputStream bufferedinputstream=null;
BufferedOutputStream bufferedoutputstream=null;

java.io.InputStream inputstream = httpurlconnection.getInputStream();
bufferedinputstream = new BufferedInputStream(inputstream);
bufferedoutputstream = new BufferedOutputStream(httpservletresponse.getOutputStream());

int j;
long byteCount=0;

while((j = bufferedinputstream.read(abyte0, 0, 1024)) != -1)
{
byteCount=byteCount+j;
if(logger != null && logger.traceOn())
{
logger.log("total"+byteCount);
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: java.io.IOException: WEB8004: Error flushing the output stream
at org.apache.coyote.tomcat5.OutputBuffer.doFlush(OutputBuffer.java:343)
at org.apache.coyote.tomcat5.OutputBuffer.flush(OutputBuffer.java:313)
at org.apache.coyote.tomcat5.CoyoteOutputStream.flush(CoyoteOutputStream.java:147)
at java.io.BufferedOutputStream.flush(BufferedOutputStream.java:124)
at com.reuters.bdec.as.ASRequestHandler.processResponse(ASRequestHandler.java:285)
at com.reuters.bdec.as.ASRequestHandler.initiateGetRequest(ASRequestHandler.java:89)
at com.reuters.bdec.as.ASRequestHandler.proceedToDestination(ASRequestHandler.java:220)
at com.reuters.bdec.as.ASExtension.authorisationCheck(ASExtension.java:84)
at com.reuters.bdec.as.ASExtension.doGet(ASExtension.java:114)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:794)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:915)
at org.apache.catalina.core.ApplicationFilterChain.servletService(ApplicationFilterChain.java:398)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:277)
at org.apache.catalina.core.StandardContextValve.invokeInternal(StandardContextValve.java:255)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:188)
at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:586)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:556)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:187)
at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:586)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:556)
at com.sun.webserver.connector.nsapi.NSAPIProcessor.service(NSAPIProcessor.java:160)
Caused by: java.io.IOException: WEB8004: Error flushing the output stream
at com.sun.webserver.connector.nsapi.NSAPIProcessor.action(NSAPIProcessor.java:243)
at org.apache.coyote.Response.action(Response.java:197)
at org.apache.coyote.tomcat5.OutputBuffer.doFlush(OutputBuffer.java:339)
... 20 more
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Error flushing the output stream in Sun One server