poi-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject [Bug 59058] OOM when parsing docx after OPCPackage.open with File but not with InputStream (TIKA-1866)
Date Wed, 24 Feb 2016 13:49:06 GMT
https://bz.apache.org/bugzilla/show_bug.cgi?id=59058

--- Comment #7 from Tim Allison <tallison@mitre.org> ---
In XWPFDocument's onDocumentRead(), if we change:

            DocumentDocument doc =
DocumentDocument.Factory.parse(getPackagePart().getInputStream(),
DEFAULT_XML_OPTIONS);


to:

            XMLInputFactory xmlif = XMLInputFactory.newInstance();
            XMLStreamReader reader =
xmlif.createXMLStreamReader(getPackagePart().getInputStream());

            DocumentDocument doc = DocumentDocument.Factory.parse(reader,
DEFAULT_XML_OPTIONS);

We can parse both files.

This change is on the periphery of my competence.  Any problems with this?  How
can we require xerces via .newInstance()/newFactory()?

-- 
You are receiving this mail because:
You are the assignee for the bug.

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


Mime
View raw message