论坛首页 Java企业应用论坛

POI 导出excel数据量大的时候的解决方案

浏览 4094 次
该帖已经被评为隐藏帖
作者 正文
   发表时间:2008-04-30  
POI 在导出大量数据到response中的时候报socket错误(其实文件已经导出来了,数据量在21000左右,4列),请问大家是怎么解决的。
当数据量小的时候没有问题!错误信息如下。

workBook.write(outputStream);
outputStream.flush();
outputStream.close();


ClientAbortException:  java.net.SocketException: Software caused connection abort: socket write error
2008-04-30 15:41:07,625 ERROR (org.apache.catalina.core.ContainerBase.[Catalina].[localhost].[/manage].[default]:253) - Servlet.service() for servlet default threw exception
java.net.SocketException: Software caused connection abort: socket write error
at java.net.SocketOutputStream.socketWrite0(Native Method)
at java.net.SocketOutputStream.socketWrite(SocketOutputStream.java:92)
at java.net.SocketOutputStream.write(SocketOutputStream.java:136)
at org.apache.coyote.http11.InternalOutputBuffer.realWriteBytes(InternalOutputBuffer.java:747)
at org.apache.tomcat.util.buf.ByteChunk.flushBuffer(ByteChunk.java:432)
at org.apache.tomcat.util.buf.ByteChunk.append(ByteChunk.java:347)
at org.apache.coyote.http11.InternalOutputBuffer$OutputStreamOutputBuffer.doWrite(InternalOutputBuffer.java:770)
at org.apache.coyote.http11.filters.IdentityOutputFilter.doWrite(IdentityOutputFilter.java:127)
at org.apache.coyote.http11.InternalOutputBuffer.doWrite(InternalOutputBuffer.java:580)
at org.apache.coyote.Response.doWrite(Response.java:560)
at org.apache.catalina.connector.OutputBuffer.realWriteBytes(OutputBuffer.java:361)
at org.apache.tomcat.util.buf.ByteChunk.flushBuffer(ByteChunk.java:432)
at org.apache.catalina.connector.OutputBuffer.doFlush(OutputBuffer.java:314)
at org.apache.catalina.connector.OutputBuffer.flush(OutputBuffer.java:293)
at org.apache.catalina.connector.CoyoteOutputStream.flush(CoyoteOutputStream.java:98)
at com.winkee.keyword.util.KeywordDownloadExcel.downloadKeyWord(KeywordDownloadExcel.java:97)
at com.winkee.keyword.web.KeywordAction.list(KeywordAction.java:190)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at com.opensymphony.xwork2.DefaultActionInvocation.invokeAction(DefaultActionInvocation.java:404)
论坛首页 Java企业应用版

跳转论坛:
Global site tag (gtag.js) - Google Analytics