poi-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dominik Stadler <dominik.stad...@gmx.at>
Subject Re: [Bug 57042] Writing Large Excel Sheet (~150K rows) causing the api to dump large xml file at /tmp dir. Also does not compress & cleanup up causing the /tmp/ disk space full
Date Sun, 12 Oct 2014 09:54:13 GMT
Hi,

SXSSFWorkbook uses class TempFile, which uses
DefaultTempFileCreationStrategy which uses the system property
java.io.tmpdir by default. So one  option is to set this property
differently, however this can affect other frameworks/libraries and
JDK functionality itself as well. Alternatively you can set a
different strategy/dir via
org.apache.poi.util.TempFile.setTempFileCreationStrategy(), e.g. you
can set a different directory via

org.apache.poi.util.TempFile.setTempFileCreationStrategy(new
org.apache.poi.util.TempFile.DefaultTempFileCreationStrategy(new
File("/var/tmp")))

Dominik.

On Mon, Oct 6, 2014 at 8:30 PM, Banerjee, Tapas <Tapas.Banerjee@fmr.com> wrote:
> As suggested below,  removing old (2.6) xerces jar, and linking the latest 2.11   xercesImpl.jars,
solved the exception issue.
> Now I can export files at my local PC environment. We'll test with bigger files by deploying
the code to Unix server.
>
> Question: Is there a way (API call?) we can change location of dumping Xml file ( currently
/tmp) by the POI - SXSSF api?
>
>  Thanks,
>
>
> -----Original Message-----
> From: Dominik Stadler [mailto:dominik.stadler@gmx.at]
> Sent: Friday, October 03, 2014 5:03 PM
> To: POI Developers List
> Subject: RE: [Bug 57042] Writing Large Excel Sheet (~150K rows) causing the api to dump
large xml file at /tmp dir. Also does not compress & cleanup up causing the /tmp/ disk
space full
>
> the root cause is a very outdated xml parser implementation which you are
> loading via the classpath. Ideally you should try to upgrade or remove
> xerces jar files or other old xml implementation from your classpath, jdk
> comes with the same features since a long time, however unfortunately some
> 3rd party libs still hard-depend on these old libs.
>
> Alternatively you can try a nightly build where this error is prevented for
> backwards compatibility.
>
> Dominik
> Am 03.10.2014 17:29 schrieb "Banerjee, Tapas" <Tapas.Banerjee@fmr.com>:
>
>> Nick,
>>
>> I added code to print version. It shows it is pointing to 3/11 (dev)
>>
>> However,  when  I try to export to excel, I am getting below error.
>>
>>
>>
>> Core POI came from
>> file:/C:/ccrc/a475324_EBS_ORWS_UI_03.05.00_rtp_d/WFM/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/wtpwebapps/.../WEB-INF/lib/poi-3.11-beta2-20140822.jar!/org/apache/poi/poifs/filesystem/POIFSFileSystem.class
>>
>> Oct 3, 2014 11:18:59 AM org.apache.catalina.core.StandardWrapperValve
>> invoke
>>
>> SEVERE: Servlet.service() for servlet ExportExcelServlet threw exception
>>
>> java.lang.AbstractMethodError:
>> javax.xml.parsers.DocumentBuilderFactory.setFeature(Ljava/lang/String;Z)V
>>
>>                 at
>> org.apache.poi.util.DocumentHelper.trySetSAXFeature(DocumentHelper.java:62)
>>
>>                 at
>> org.apache.poi.util.DocumentHelper.<clinit>(DocumentHelper.java:56)
>>
>>                 at
>> org.apache.poi.openxml4j.opc.internal.marshallers.ZipPartMarshaller.marshallRelationshipPart(ZipPartMarshaller.java:120)
>>
>>                 at
>> org.apache.poi.openxml4j.opc.ZipPackage.saveImpl(ZipPackage.java:464)
>>
>>                 at
>> org.apache.poi.openxml4j.opc.OPCPackage.save(OPCPackage.java:1425)
>>
>>                 at
>> org.apache.poi.POIXMLDocument.write(POIXMLDocument.java:201)
>>
>>                 at
>> org.apache.poi.xssf.streaming.SXSSFWorkbook.write(SXSSFWorkbook.java:830)
>>
>>                 at
>> com.fmr.orws.excel.SendXLS2GUI.doPost(SendXLS2GUI.java:55)
>>
>>
>>
>> I see this issue is listed in Poi dev mailing list.
>>
>> Any idea, how I can solve the issue?
>>
>>
>>
>>
>> http://mail-archives.apache.org/mod_mbox/poi-dev/201408.mbox/%3CCABdJj56oEQoAf7iCuoDL7e_1CGDQDQspEg+VksZudYrFoF16VA@mail.gmail.com%3E
>>
>>
>>
>> Thanks,
>>
>>
>>
>> -----Original Message-----
>> From: Nick Burch [mailto:apache@gagravarr.org]
>> Sent: Wednesday, October 01, 2014 1:41 PM
>> To: POI Developers List
>> Subject: RE: [Bug 57042] Writing Large Excel Sheet (~150K rows) causing
>> the api to dump large xml file at /tmp dir. Also does not compress &
>> cleanup up causing the /tmp/ disk space full
>>
>>
>>
>> On Wed, 1 Oct 2014, Banerjee, Tapas wrote:
>>
>> > Is there way I can find which version of POI library (e.g. 3.10 or
>>
>> > 3.11..)  my build is linking programmatically?
>>
>>
>>
>> Assuming you haven't renamed jars, try the code from the FAQ:
>>
>> http://poi.apache.org/faq.html#faq-N10006
>>
>>
>>
>> There's also org.apache.poi.Version
>>
>>
>>
>> Nick
>>
>>
>>
>> ---------------------------------------------------------------------
>>
>> To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org<mailto:
>> dev-unsubscribe@poi.apache.org>
>>
>> For additional commands, e-mail: dev-help@poi.apache.org<mailto:
>> dev-help@poi.apache.org>
>>
>>
>>

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org


Mime
View raw message