简体   繁体   English

如何从Liferay Portlet读取Excel文件?

[英]How to read an Excel file from a liferay portlet?

I am developing an application based on Liferay, inside the " processAction " method I am calling a function from my class which is supposed to read an Excel file, but when I put this portlet on liferay it gives me errors such as: 我正在开发基于Liferay的应用程序,该方法在“ processAction ”方法内部,我从类中调用一个函数,该类应该读取Excel文件,但是当我将此portlet放在liferay上时,会出现诸如以下错误:

" org.apache.poi.POIXMLException: java.lang.reflect.invocationtargetexception in java " org.apache.poi.POIXMLException:java中的java.lang.reflect.invocationtargetexception

Even i had got this problem and please provide full stacktrace. 即使我遇到了这个问题,也请提供完整的stacktrace。

In your Exception stacktrace check for 在您的异常stacktrace中检查

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

this is because JVM doesnt have enough memory try increasing JVM memory. 这是因为JVM没有足够的内存,请尝试增加JVM内存。

The other problem many be your using old xmlbeans.jar file try using the latest 另一个问题是您使用旧的xmlbeans.jar文件尝试使用最新的

I was missing the stax API jar 我错过了stax API jar

If we look at the POI Components page we will see that the ooxml-schemas jar depends on a STAX API jar (most typically provided by stax-api-1.0.1.jar) 如果查看POI组件页面,我们将看到ooxml-schemas jar取决于STAX API jar(通常由stax-api-1.0.1.jar提供)

I Looked in my POI binary download, and in the ooxml-lib directory to see the jar I needed. 我在POI二进制文件下载和ooxml-lib目录中查看了我需要的jar。

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

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