What is the reason for poi reading word error?

error message: Caused by: org.apache.xmlbeans.XmlException: Element themeManager@ http://schemas.openxmlformats. is not a valid document@ http://schemas.openxmlformats. document or a valid substitution.

error code:
XWPFDocument doc = new XWPFDocument (POIXMLDocument.openPackage (srcPath));
what is the reason for the error in the package as soon as word is loaded?

Poi
Mar.11,2021

poi includes support for both doc and docx formats. XWPFDocument supports docx. Are you opening an docx document? If it is not a docx, but an doc document, use HWPFDocument

Menu