Bug 58920 - java.lang.IllegalArgumentException: Value for parameter 'id' was out of bounds when parsing docx
Summary: java.lang.IllegalArgumentException: Value for parameter 'id' was out of bound...
Alias: None
Product: POI
Classification: Unclassified
Component: XWPF (show other bugs)
Version: 3.13-FINAL
Hardware: PC Linux
: P2 minor (vote)
Target Milestone: ---
Assignee: POI Developers List
Depends on:
Reported: 2016-01-25 21:55 UTC by gaspar.pizarro.v
Modified: 2016-01-26 08:57 UTC (History)
0 users

Problematic unparseable document (32.85 KB, application/vnd.openxmlformats-officedocument.wordprocessingml.document)
2016-01-25 21:55 UTC, gaspar.pizarro.v
Error when opening the file with Microsoft Office (9.36 KB, image/png)
2016-01-26 08:55 UTC, Dominik Stadler

Note You need to log in before you can comment on or make changes to this bug.
Description gaspar.pizarro.v 2016-01-25 21:55:38 UTC
Created attachment 33491 [details]
Problematic unparseable document

I have the exception 
java.lang.IllegalArgumentException: Value for parameter 'id' was out of bounds
	at org.apache.poi.util.IdentifierManager.reserve(IdentifierManager.java:80)
	at org.apache.poi.xwpf.usermodel.XWPFRun.<init>(XWPFRun.java:111)
	at org.apache.poi.xwpf.usermodel.XWPFRun.<init>(XWPFRun.java:156)
	at org.apache.poi.xwpf.usermodel.XWPFParagraph.buildRunsInOrderFromXml(XWPFParagraph.java:134)
	at org.apache.poi.xwpf.usermodel.XWPFParagraph.<init>(XWPFParagraph.java:87)
	at org.apache.poi.xwpf.usermodel.XWPFHeader.onDocumentRead(XWPFHeader.java:116)
	at org.apache.poi.xwpf.usermodel.XWPFDocument.onDocumentRead(XWPFDocument.java:183)
	at org.apache.poi.POIXMLDocument.load(POIXMLDocument.java:166)
	at org.apache.poi.xwpf.usermodel.XWPFDocument.<init>(XWPFDocument.java:118)
	at org.apache.poi.xwpf.extractor.XWPFWordExtractor.<init>(XWPFWordExtractor.java:59)
	at org.apache.poi.extractor.ExtractorFactory.createExtractor(ExtractorFactory.java:181)
	at org.apache.tika.parser.microsoft.ooxml.OOXMLExtractorFactory.parse(OOXMLExtractorFactory.java:86)
	... 99 more

when parsing the attached document with Tika, while using (according to its POM) POI 3.13. It was created using LibreOffice.
Comment 1 Dominik Stadler 2016-01-26 08:55:47 UTC
Created attachment 33492 [details]
Error when opening the file with Microsoft Office
Comment 2 Dominik Stadler 2016-01-26 08:57:48 UTC
When using latest POI, I get a different error:

Caused by: org.apache.xmlbeans.XmlException: error: duplicate attribute 'w:eastAsia'
	at org.apache.xmlbeans.impl.store.Locale$SaxLoader.load(Locale.java:3511)

and when I try to open the file in Microsoft Word, I get a similar error message, see screenshot. 

Therefore it seems this file is not correctly written in the first place and you need to discuss with the developers of LibreOffice to see if there is a bug there.