且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

使用 apache poi 读取 .xlsx 文件在 linux 机器上给出 org.apache.poi.POIXMLException

更新时间:2021-07-03 17:17:40

提升对答案的评论...

Promoting a comment to an answer...

堆栈跟踪的关键部分是:

The key part of your stacktrace, which explains what has broken and why, is:

Caused by: java.lang.OutOfMemoryError: Java heap space at 
java.util.Arrays.copyOfRange(Arrays.java:2694)

这告诉我们 Java 没有分配足够的内存来存储处理文件所需的所有数据

This is telling us that Java didn't have enough memory allocated to it to store all of the data that processing your file entails

如果您在增加 JVM 堆大小方面需要帮助,我建议您查看 上一个问题这个,它们都会告诉你全部.

If you need help with increasing your JVM heap size, I would suggest you review this previous question or this one, which both talk you through it all.