You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@poi.apache.org by bu...@apache.org on 2018/09/26 10:21:26 UTC
[Bug 62763] New: HWPFDocument(POIFSFileSystem pfilesystem)
Constructor exception
https://bz.apache.org/bugzilla/show_bug.cgi?id=62763
Bug ID: 62763
Summary: HWPFDocument(POIFSFileSystem pfilesystem) Constructor
exception
Product: POI
Version: 4.0.0-FINAL
Hardware: PC
Status: NEW
Severity: normal
Priority: P2
Component: HWPF
Assignee: dev@poi.apache.org
Reporter: 986619781@qq.com
Target Milestone: ---
my code:
content = "1111";
ByteArrayInputStream byteArrayInputStream = new
ByteArrayInputStream(content.getBytes());
String realPathFile = DIR_IN + "empty.doc";
POIFSFileSystem poifsFileSystem = new POIFSFileSystem(new
FileInputStream(realPathFile));
poifsFileSystem.createOrUpdateDocument(byteArrayInputStream,
"WordDocument");
HWPFDocument hwpfDocument = new HWPFDocument(poifsFileSystem);
hwpfDocument.write(new FileOutputStream(DIR_OUT + outFileName));
hwpfDocument.close();
poifsFileSystem.close();
byteArrayInputStream.close();
console exception:
Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: 11
at org.apache.poi.util.LittleEndian.getShort(LittleEndian.java:253)
at
org.apache.poi.hwpf.model.types.FibBaseAbstractType.fillFields(FibBaseAbstractType.java:95)
at org.apache.poi.hwpf.model.FibBase.<init>(FibBase.java:43)
at
org.apache.poi.hwpf.HWPFDocumentCore.getEncryptionInfo(HWPFDocumentCore.java:255)
at
org.apache.poi.hwpf.HWPFDocumentCore.getDocumentEntryBytes(HWPFDocumentCore.java:327)
at
org.apache.poi.hwpf.HWPFDocumentCore.<init>(HWPFDocumentCore.java:169)
at org.apache.poi.hwpf.HWPFDocument.<init>(HWPFDocument.java:193)
at org.apache.poi.hwpf.HWPFDocument.<init>(HWPFDocument.java:177)
at com.snoopy.poi.HTML2doc.main(HTML2doc.java:55)
--
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
[Bug 62763] HWPFDocument(POIFSFileSystem pfilesystem) Constructor
exception
Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=62763
Dominik Stadler <do...@gmx.at> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |NEEDINFO
OS| |All
--- Comment #1 from Dominik Stadler <do...@gmx.at> ---
Seems the document is corrupt or at least confuses Apache POI, can you attach
it? Does it open in Microsoft Word without errors being shown?
--
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