OfficeXmlFileException。我如何解决这个问题?

OfficeXmlFileException。我如何解决这个问题?,exception,apache-poi,Exception,Apache Poi,线程中的异常 "main" org.apache.poi.poifs.filesystem.OfficeXmlFileException: The supplied data appears to be in the Office 2007+ XML. You are calling the part of POI that deals with OLE2 Office Documents. You need to call a different part of POI to process

线程中的异常

"main" org.apache.poi.poifs.filesystem.OfficeXmlFileException: The supplied data appears to be in the Office 2007+ XML. You are calling the part of POI that deals with OLE2 Office Documents. You need to call a different part of POI to process this data (eg XSSF instead of HSSF)

如何解决这个错误

按照线程中的建议,您应该在
HSSF
或其他更高版本的API上使用
XSSF
。 你也可以分享你的代码片段