Read Excel using Apache POI - Exception in thread "main" org.apache.poi.poifs.filesystem.OfficeXmlFileException:

Read Excel using Apache POI - Challenges
1) Exception in thread "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)

Add following maven dependency
-- Use poi-ooxml from xlsx files while poi for xls
<!-- POI : Excel library -->  
       < groupId>org.apache.poi</groupId> 

2)Caused by: java.lang.ClassNotFoundException: org.apache.xmlbeans.XmlException
-- Reading excel using apache POI – Add library xmlbeans-x.x.x.jar from maven

3) Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/commons/collections4/ListValuedMap
-- add library from common collections (from maven)

Popular posts from this blog

Can not connect to git using ssh (Permissions 0644 for '/root/.ssh/id_rsa' are too open.

Upload file on Google cloud storage using Java servlet on google app engine

Session timeout interceptor in struts 2