Details
Description
On the attached Word template, which opens fine with Word, the Tika parser throws the following error:
org.apache.poi.POIXMLException: java.lang.reflect.InvocationTargetException
at org.apache.poi.POIXMLFactory.createDocumentPart(POIXMLFactory.java:65)
at org.apache.poi.POIXMLDocumentPart.read(POIXMLDocumentPart.java:601)
at org.apache.poi.POIXMLDocumentPart.read(POIXMLDocumentPart.java:613)
at org.apache.poi.POIXMLDocument.load(POIXMLDocument.java:156)
at org.apache.poi.xwpf.usermodel.XWPFDocument.<init>(XWPFDocument.java:124)
at org.apache.poi.xwpf.extractor.XWPFWordExtractor.<init>(XWPFWordExtractor.java:58)
at org.apache.poi.extractor.ExtractorFactory.createExtractor(ExtractorFactory.java:237)
at org.apache.tika.parser.microsoft.ooxml.OOXMLExtractorFactory.parse(OOXMLExtractorFactory.java:86)
at org.apache.tika.parser.microsoft.ooxml.OOXMLParser.parse(OOXMLParser.java:87)
Caused by: java.lang.reflect.InvocationTargetException
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:422)
at org.apache.poi.xwpf.usermodel.XWPFFactory.createDocumentPart(XWPFFactory.java:57)
at org.apache.poi.POIXMLFactory.createDocumentPart(POIXMLFactory.java:60)
... 10 more
Caused by: java.lang.ClassCastException: org.apache.poi.POIXMLDocumentPart cannot be cast to org.apache.poi.xwpf.usermodel.XWPFDocument
at org.apache.poi.xwpf.usermodel.XWPFHeaderFooter.<init>(XWPFHeaderFooter.java:74)
at org.apache.poi.xwpf.usermodel.XWPFHeader.<init>(XWPFHeader.java:54)
... 16 more