Ciao a tutti,
sto recuperando due pdf da un web service, questi vengono inseriti in uno zip file che viene scritto sull'output stream. Questo è il codice :

try{

response.setContentType("application/zip");
response.setHeader("Expires", "0");
response.setHeader("Cache-Control", "must-revalidate, post-check=0, pre-check=0");
response.setHeader("Pragma", "public");
response.setHeader("Content-disposition", "attachment; filename=archiveInsurance.zip");
zos = new ZipOutputStream(stream);
for(int i=0;i< members.size();i++){
JHMember member = (JHMember) members.get(i);
ClientData clientData = member.getClientData();
String fileName = "pdfApplicationDocumentNDG=";
logger.info(this,"Adding file NDG"+(i+1));

//begin writing a new ZIP entry, positions the stream to the start of the entry data
zos.putNextEntry(new ZipEntry(fileName+""+clientData.getNdg()+".pdf"));
zos.write(((ByteArrayOutputStream) request.getSession().getAttribute("ndg"+(i+1))).to ByteArray());
//zos.write(byteArrayOutputStream[i].toByteArray());
zos.closeEntry();

}


}catch(IOException ioe){
logger.error(this,"Error creating zip file" + ioe);
throw new Exception(ioe);
} finally{
//close the ZipOutputStream
zos.close();
stream.flush();
stream.close();

}

Tutto fuonziona perfettamente quando ieri ricevo questa bella eccezione :


java.lang.Exception: com.ibm.wsspi.webcontainer.ClosedConnectionExcepti on: OutputStream encountered error during write
at it.usi.xframe.uwm.pfstruts.actions.ek.steps.Disbur sementAction.doPrintErgoInsurance(DisbursementActi on.java:1251)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Nativ e Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Native MethodAccessorImpl.java:48)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(De legatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:600)
at org.apache.struts.actions.DispatchAction.dispatchM ethod(DispatchAction.java:274)
at org.apache.struts.actions.DispatchAction.execute(D ispatchAction.java:194)
at org.apache.struts.action.RequestProcessor.processA ctionPerform(RequestProcessor.java:419)
at org.apache.struts.action.RequestProcessor.process( RequestProcessor.java:224)
at org.apache.struts.action.ActionServlet.process(Act ionServlet.java:1194)
at it.usi.xframe.system.pfutil.ActionDecoratorServlet .processDecoration(ActionDecoratorServlet.java:170 )
at it.usi.xframe.system.pfutil.ActionDecoratorServlet .process(ActionDecoratorServlet.java:110)
at org.apache.struts.action.ActionServlet.doGet(Actio nServlet.java:414)
at it.usi.xframe.system.pfutil.ActionDecoratorServlet .doPost(ActionDecoratorServlet.java:76)
at javax.servlet.http.HttpServlet.service(HttpServlet .java:738)
at javax.servlet.http.HttpServlet.service(HttpServlet .java:831)
at com.ibm.ws.webcontainer.servlet.ServletWrapper.ser vice(ServletWrapper.java:1661)
at com.ibm.ws.webcontainer.servlet.ServletWrapper.ser vice(ServletWrapper.java:1602)
at com.ibm.ws.webcontainer.filter.WebAppFilterChain.d oFilter(WebAppFilterChain.java:113)
at com.ibm.ws.webcontainer.filter.WebAppFilterChain._ doFilter(WebAppFilterChain.java:80)
at com.ibm.ws.webcontainer.filter.WebAppFilterManager .doFilter(WebAppFilterManager.java:908)
at com.ibm.ws.webcontainer.servlet.ServletWrapper.han dleRequest(ServletWrapper.java:939)
at com.ibm.ws.webcontainer.servlet.ServletWrapper.han dleRequest(ServletWrapper.java:507)
at com.ibm.ws.webcontainer.servlet.ServletWrapperImpl .handleRequest(ServletWrapperImpl.java:181)
at com.ibm.ws.webcontainer.webapp.WebApp.handleReques t(WebApp.java:3954)
at com.ibm.ws.webcontainer.webapp.WebGroup.handleRequ est(WebGroup.java:276)
at com.ibm.ws.webcontainer.WebContainer.handleRequest (WebContainer.java:945)
at com.ibm.ws.webcontainer.WSWebContainer.handleReque st(WSWebContainer.java:1592)
at com.ibm.ws.webcontainer.channel.WCChannelLink.read y(WCChannelLink.java:191)
at com.ibm.ws.http.channel.inbound.impl.HttpInboundLi nk.handleDiscrimination(HttpInboundLink.java:453)
at com.ibm.ws.http.channel.inbound.impl.HttpInboundLi nk.handleNewRequest(HttpInboundLink.java:515)
at com.ibm.ws.http.channel.inbound.impl.HttpInboundLi nk.processRequest(HttpInboundLink.java:306)
at com.ibm.ws.http.channel.inbound.impl.HttpICLReadCa llback.complete(HttpICLReadCallback.java:84)
at com.ibm.ws.tcp.channel.impl.AioReadCompletionListe ner.futureCompleted(AioReadCompletionListener.java :175)
at com.ibm.io.async.AbstractAsyncFuture.invokeCallbac k(AbstractAsyncFuture.java:217)
at com.ibm.io.async.AsyncChannelFuture.fireCompletion Actions(AsyncChannelFuture.java:161)
at com.ibm.io.async.AsyncFuture.completed(AsyncFuture .java:138)
at com.ibm.io.async.ResultHandler.complete(ResultHand ler.java:204)
at com.ibm.io.async.ResultHandler.runEventProcessingL oop(ResultHandler.java:775)
at com.ibm.io.async.ResultHandler$2.run(ResultHandler .java:905)
at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.j ava:1656)
Caused by: com.ibm.wsspi.webcontainer.ClosedConnectionExcepti on: OutputStream encountered error during write
at com.ibm.ws.webcontainer.channel.WCCByteBufferOutpu tStream.write(WCCByteBufferOutputStream.java:106)
at com.ibm.ws.webcontainer.srt.SRTOutputStream.write( SRTOutputStream.java:97)
at com.ibm.wsspi.webcontainer.util.BufferedServletOut putStream.writeOut(BufferedServletOutputStream.jav a:592)
at com.ibm.wsspi.webcontainer.util.BufferedServletOut putStream.flushBytes(BufferedServletOutputStream.j ava:435)
at com.ibm.wsspi.webcontainer.util.BufferedServletOut putStream.write(BufferedServletOutputStream.java:3 85)
at java.util.zip.DeflaterOutputStream.deflate(Deflate rOutputStream.java:155)
at java.util.zip.DeflaterOutputStream.write(DeflaterO utputStream.java:112)
at java.util.zip.ZipOutputStream.write(ZipOutputStrea m.java:272)
at java.io.FilterOutputStream.write(FilterOutputStrea m.java:80)
at it.usi.xframe.uwm.pfstruts.actions.ek.steps.Disbur sementAction.doPrintErgoInsurance(DisbursementActi on.java:1241)
... 40 more
Caused by: java.io.IOException: Async IO operation failed (3), reason: RC: 107 Transport endpoint is not connected
at com.ibm.io.async.AsyncLibrary$IOExceptionCache.<in it>(AsyncLibrary.java:891)
at com.ibm.io.async.AsyncLibrary$IOExceptionCache.get (AsyncLibrary.java:904)
at com.ibm.io.async.AsyncLibrary.getIOException(Async Library.java:918)
at com.ibm.io.async.ResultHandler.runEventProcessingL oop(ResultHandler.java:705)

Facendo varie ricerche ho capito che la connessione viene chiusa lato-server ancora prima che è ricevuta completamente la risposta lato-client, e che bisogna incrementare i tempi di timeout ( HttpInboundPersistReadTimeout ). Sapete aiutarmi un pò e cercare una soluzione ?
Grazie a tutti