POI导出excel文件,IE8保存时报错!

发布于 2021-11-28 02:24:06 字数 8602 浏览 461 评论 3

使用POI导出excel文件,在IE8下出现异常,谷歌和火狐正常。

但是这种异常吧也不是每次导出都发生的,有时候却没有发生。

我在网上百度过,也有一些人遇到过,怎么都说是点击取消按钮的时候出现的异常,我是点击保存按钮的时候出现的异常。回复也是五花八门的,我试了几种方案,但是没有效果。大家做导出应该都遇到的,给点经验看看怎么解决,少走弯路。

出现的异常:

ClientAbortException:  java.io.IOException

at org.apache.catalina.connector.OutputBuffer.realWriteBytes(OutputBuffer.java:369)

at org.apache.tomcat.util.buf.ByteChunk.flushBuffer(ByteChunk.java:437)

at org.apache.tomcat.util.buf.ByteChunk.append(ByteChunk.java:351)

at org.apache.catalina.connector.OutputBuffer.writeBytes(OutputBuffer.java:392)

at org.apache.catalina.connector.OutputBuffer.write(OutputBuffer.java:381)

at org.apache.catalina.connector.CoyoteOutputStream.write(CoyoteOutputStream.java:93)

at org.apache.catalina.connector.CoyoteOutputStream.write(CoyoteOutputStream.java:86)

at org.apache.poi.poifs.storage.BigBlock.doWriteData(BigBlock.java:67)

at org.apache.poi.poifs.storage.DocumentBlock.writeData(DocumentBlock.java:195)

at org.apache.poi.poifs.storage.BigBlock.writeBlocks(BigBlock.java:98)

at org.apache.poi.poifs.storage.DocumentBlock.writeBlocks(DocumentBlock.java:34)

at org.apache.poi.poifs.filesystem.POIFSDocument$BigBlockStore.writeBlocks(POIFSDocument.java:547)

at org.apache.poi.poifs.filesystem.POIFSDocument.writeBlocks(POIFSDocument.java:303)

at org.apache.poi.poifs.filesystem.POIFSFileSystem.writeFilesystem(POIFSFileSystem.java:385)

at org.apache.poi.hssf.usermodel.HSSFWorkbook.write(HSSFWorkbook.java:1194)

at com.bdqn.utils.ResponseUtil.export(ResponseUtil.java:23)

at com.bdqn.servlet.MainExportServlet.doGet(MainExportServlet.java:49)

at javax.servlet.http.HttpServlet.service(HttpServlet.java:621)

at javax.servlet.http.HttpServlet.service(HttpServlet.java:722)

at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:304)

at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)

at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:240)

at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:164)

at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:462)

at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:164)

at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:100)

at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:563)

at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)

at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:399)

at org.apache.coyote.http11.Http11AprProcessor.process(Http11AprProcessor.java:306)

at org.apache.coyote.http11.Http11AprProtocol$Http11ConnectionHandler.process(Http11AprProtocol.java:322)

at org.apache.tomcat.util.net.AprEndpoint$SocketProcessor.run(AprEndpoint.java:1732)

at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)

at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)

at java.lang.Thread.run(Thread.java:722)

Caused by: java.io.IOException

at org.apache.coyote.http11.InternalAprOutputBuffer.flushBuffer(InternalAprOutputBuffer.java:208)

at org.apache.coyote.http11.InternalAprOutputBuffer$SocketOutputBuffer.doWrite(InternalAprOutputBuffer.java:238)

at org.apache.coyote.http11.filters.ChunkedOutputFilter.doWrite(ChunkedOutputFilter.java:119)

at org.apache.coyote.http11.AbstractOutputBuffer.doWrite(AbstractOutputBuffer.java:190)

at org.apache.coyote.Response.doWrite(Response.java:533)

at org.apache.catalina.connector.OutputBuffer.realWriteBytes(OutputBuffer.java:364)

... 34 more

八月 05, 2014 3:36:57 下午 com.mchange.v2.c3p0.impl.NewPooledConnection logCloseExceptions

INFO: [c3p0] Exceptions occurred while trying to close a PooledConnection's resources normally.

八月 05, 2014 3:36:57 下午 com.mchange.v2.c3p0.impl.NewPooledConnection logCloseExceptions

INFO: [c3p0] NewPooledConnection close Exception.

java.sql.SQLException: Io 异常: Software caused connection abort: recv failed

at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:112)

at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:146)

at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:255)

at oracle.jdbc.driver.T4CConnection.logoff(T4CConnection.java:481)

at oracle.jdbc.driver.PhysicalConnection.close(PhysicalConnection.java:1203)

at com.mchange.v2.c3p0.impl.NewPooledConnection.close(NewPooledConnection.java:549)

at com.mchange.v2.c3p0.impl.NewPooledConnection.close(NewPooledConnection.java:234)

at com.mchange.v2.c3p0.impl.C3P0PooledConnectionPool$1PooledConnectionResourcePoolManager.destroyResource(C3P0PooledConnectionPool.java:470)

at com.mchange.v2.resourcepool.BasicResourcePool$1DestroyResourceTask.run(BasicResourcePool.java:964)

at com.mchange.v2.async.ThreadPoolAsynchronousRunner$PoolThread.run(ThreadPoolAsynchronousRunner.java:547)

八月 05, 2014 3:36:57 下午 com.mchange.v2.resourcepool.BasicResourcePool$1DestroyResourceTask run

WARNING: Failed to destroy resource: com.mchange.v2.c3p0.impl.NewPooledConnection@191a8e6

java.sql.SQLException: Some resources failed to close properly while closing com.mchange.v2.c3p0.impl.NewPooledConnection@191a8e6

at com.mchange.v2.c3p0.impl.NewPooledConnection.close(NewPooledConnection.java:571)

at com.mchange.v2.c3p0.impl.NewPooledConnection.close(NewPooledConnection.java:234)

at com.mchange.v2.c3p0.impl.C3P0PooledConnectionPool$1PooledConnectionResourcePoolManager.destroyResource(C3P0PooledConnectionPool.java:470)

at com.mchange.v2.resourcepool.BasicResourcePool$1DestroyResourceTask.run(BasicResourcePool.java:964)

at com.mchange.v2.async.ThreadPoolAsynchronousRunner$PoolThread.run(ThreadPoolAsynchronousRunner.java:547)

八月 05, 2014 3:37:45 下午 com.mchange.v2.c3p0.impl.NewPooledConnection logCloseExceptions

INFO: [c3p0] Exceptions occurred while trying to close a PooledConnection's resources normally.

八月 05, 2014 3:37:45 下午 com.mchange.v2.c3p0.impl.NewPooledConnection logCloseExceptions

INFO: [c3p0] NewPooledConnection close Exception.

java.sql.SQLException: Io 异常: Software caused connection abort: recv failed

at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:112)

at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:146)

at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:255)

at oracle.jdbc.driver.T4CConnection.logoff(T4CConnection.java:481)

at oracle.jdbc.driver.PhysicalConnection.close(PhysicalConnection.java:1203)

at com.mchange.v2.c3p0.impl.NewPooledConnection.close(NewPooledConnection.java:549)

at com.mchange.v2.c3p0.impl.NewPooledConnection.close(NewPooledConnection.java:234)

at com.mchange.v2.c3p0.impl.C3P0PooledConnectionPool$1PooledConnectionResourcePoolManager.destroyResource(C3P0PooledConnectionPool.java:470)

at com.mchange.v2.resourcepool.BasicResourcePool$1DestroyResourceTask.run(BasicResourcePool.java:964)

at com.mchange.v2.async.ThreadPoolAsynchronousRunner$PoolThread.run(ThreadPoolAsynchronousRunner.java:547)

八月 05, 2014 3:37:45 下午 com.mchange.v2.resourcepool.BasicResourcePool$1DestroyResourceTask run

WARNING: Failed to destroy resource: com.mchange.v2.c3p0.impl.NewPooledConnection@11b45fb

java.sql.SQLException: Some resources failed to close properly while closing com.mchange.v2.c3p0.impl.NewPooledConnection@11b45fb

at com.mchange.v2.c3p0.impl.NewPooledConnection.close(NewPooledConnection.java:571)

at com.mchange.v2.c3p0.impl.NewPooledConnection.close(NewPooledConnection.java:234)

at com.mchange.v2.c3p0.impl.C3P0PooledConnectionPool$1PooledConnectionResourcePoolManager.destroyResource(C3P0PooledConnectionPool.java:470)

at com.mchange.v2.resourcepool.BasicResourcePool$1DestroyResourceTask.run(BasicResourcePool.java:964)

at com.mchange.v2.async.ThreadPoolAsynchronousRunner$PoolThread.run(ThreadPoolAsynchronousRunner.java:547)

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

坏尐絯 2021-11-29 01:24:27

那原因是?

无人问我粥可暖 2021-11-29 00:52:27

你的代码去掉poi直接从磁盘读excel再写给前端应该一样会报错。

明媚如初 2021-11-28 22:30:26

与浏览器没关系,代码bug,我用poi导出过很多excel了,一直比较稳定

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文