Problem reading Excel 2007 file .xlsx file extention, while I am trying to read with apache poi:
InputStream file = new FileInputStream(C:\\test.xlsx);
---> XSSFWorkbook workbook = new XSSFWorkbook(file);
This line giving me an exception Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/xmlbeans/XmlObject
please, what can be cause of this error?
you need to include a jar file named
xmlbeans-x.x.x.jarthat comes under folder “your_location_of_poi\poi-x.x\ooxml-lib\” in your classpath.Note:
x.xis the version of poi that you are using andx.x.xis the version number of that jar file under the above mentioned folder