简体   繁体   English

XLConnect loadWorkbook错误 - POIXMLException(Java)

[英]XLConnect loadWorkbook error - POIXMLException (Java)

I'm trying to load a hefty Excel workbook (.xlsm format, ~30 mb) that has a large number of array calcs. 我正在尝试加载一个包含大量数组计算的大量Excel工作簿(.xlsm格式,~30 mb)。

> wb1 <- loadWorkbook("Mar_SP_20130227_V6.1.xlsm")
Error: POIXMLException (Java): java.lang.reflect.InvocationTargetException

But I am able to successfully load a values-only/no-macro version of the workbook. 但我能够成功加载工作簿的仅值/无宏版本。

> wb2 <- loadWorkbook("Mar_SP_20130227_V6.1_VALUES_ONLY.xlsx")
> wb2
[1] "Mar_SP_20130227_V6.1_VALUES_ONLY.xlsx"

What could be causing the error? 可能导致错误的原因是什么?

From the maintainer's website I can see that there can be issues with workbooks containing array calcs or unsupported formula functions, but this doesn't look like the same errror. 从维护者的网站上我可以看到包含数组计算或不支持的公式函数的工作簿可能存在问题,但这看起来不像是错误的错误。

Java Info: Java信息:

C:\> java -version
java version "1.6.0_21"
Java(TM) SE Runtime Environment (build 1.6.0_21-b07)
Java HotSpot(TM) Client VM (build 17.0-b17, mixed mode)

It turns out that the root of this error was the JVM running out of memory (even with options(java.parameters = "-Xmx1024m") ). 事实证明,这个错误的根源是JVM内存不足(即使有options(java.parameters = "-Xmx1024m") )。

I tried to increase the memory, but couldn't get the JVM to take more than -Xmx2048m , which still wasn't enough to load the workbook. 我试图增加内存,但无法让JVM占用超过-Xmx2048m ,这仍然不足以加载工作簿。

So I upgraded the JRE from 32 bit to 64 bit and ran 64 bit R. 所以我将JRE从32位升级到64位并运行64位R.

I was then able to set -Xmx4096m and successfully load my 30mb workbook. 然后我能够设置-Xmx4096m并成功加载我的30mb工作簿。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM