Discussions

General J2EE: SocketException: Broken pipe while Export the data to Excel thro

  1. I am Getting the following Exception While try to export the data to Excel through POI.... Suggest me what could be the problem java.net.SocketException: Broken pipe at java.net.SocketOutputStream.socketWrite0(Native Method) at java.net.SocketOutputStream.socketWrite(SocketOutputStream.java:92) at java.net.SocketOutputStream.write(SocketOutputStream.java:136) at weblogic.servlet.internal.ChunkUtils.writeChunkNoTransfer(ChunkUtils.java:388) at weblogic.servlet.internal.ChunkUtils.writeChunks(ChunkUtils.java:245) at weblogic.servlet.internal.ChunkOutput.flush(ChunkOutput.java:311) at weblogic.servlet.internal.ChunkOutput.checkForFlush(ChunkOutput.java:389) at weblogic.servlet.internal.ChunkOutput.write(ChunkOutput.java:254) at weblogic.servlet.internal.MultibyteOutput.write(ChunkOutput.java:484) at weblogic.servlet.internal.ChunkOutputWrapper.write(ChunkOutputWrapper.java:125) at weblogic.servlet.internal.ServletOutputStreamImpl.write(ServletOutputStreamImpl.java:184) at java.io.OutputStream.write(OutputStream.java:58) at org.apache.poi.poifs.storage.BigBlock.doWriteData(BigBlock.java:54) at org.apache.poi.poifs.storage.DocumentBlock.writeData(DocumentBlock.java:219) at org.apache.poi.poifs.storage.BigBlock.writeBlocks(BigBlock.java:85) at org.apache.poi.poifs.filesystem.POIFSDocument$BigBlockStore.writeBlocks(POIFSDocument.java:602) at org.apache.poi.poifs.filesystem.POIFSDocument.writeBlocks(POIFSDocument.java:274) at org.apache.poi.poifs.filesystem.POIFSFileSystem.writeFilesystem(POIFSFileSystem.java:262) at org.apache.poi.hssf.usermodel.HSSFWorkbook.write(HSSFWorkbook.java:742) at com.gm.owb.common.helper.ExcelReportGenerator.openExcelReport(Unknown Source) at com.gm.owb.process.web.controller.ExcelServlet.doProcess(Unknown Source) at com.gm.owb.process.web.controller.ExcelServlet.doPost(Unknown Source) at javax.servlet.http.HttpServlet.service(HttpServlet.java:760) at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) at weblogic.servlet.internal.ServletStubImpl$ServletInvocationAction.run(ServletStubImpl.java:1077) at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:465) at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:348) at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:7047) at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321) at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:121) at weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppServletContext.java:3902) at weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestImpl.java:2773) at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:224) at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:183)
  2. this means, someone 'killed' the network connection (naturally). this may occur if you cancel the download or the firewall cancels the connection. you may post some relevant code snippets, if this isn't the solution. slowfly
  3. public static final void openExcelReport(ExcelReportHolder reportHolder, HttpServletResponse response) throws OWBException { try { HSSFWorkbook wb = new HSSFWorkbook(); wb=CreateReport(reportHolder); //Write the output OutputStream outStream = response.getOutputStream(); wb.write(outStream); } catch (OWBException ex) { if (OWBLogger.isFatalEnabled()) { OWBLogger.fatal("OWBException in openExcelReport ", ex); } throw new OWBException(OWBErrorConstant.FAILED_TO_SELECT, OWBConstant.SEVERITY_FATAL, ex, true); } catch (Exception e) { if (OWBLogger.isFatalEnabled()) { OWBLogger.fatal("Exception in openExcelReport ", e); } throw new OWBException(OWBErrorConstant.FAILED_TO_SELECT, OWBConstant.SEVERITY_FATAL, e, true); } } See if it helpful... please let me know if not.
  4. we have multiple JVM's running at production base and single JVM in development(local - testing) environment. We dont see this kind of issue in development(local - testing) environment. Issue is there when we have multiple instances.
  5. Is this error happening after few mins (like 4 mins) ? If so, it is the browser that timing out the connection and causing the server to throw 'Connection Closed' error.