I get the following exception when trying to write .xlsx file using Apache POI
NoClassDefFoundError: javax/xml/stream/XMLStreamException
Here's a snippet of code: -
XSSFWorkbook wb = new XSSFWorkbook(); Sheet sheet = wb.createSheet(); Row row = sheet.createRow(0); Cell cell = row.createCell(0); cell.setCellValue(100); FileOutputStream fileOut = new FileOutputStream("D:\\workspace\\April\\Excel Test\\workbook.xlsx"); wb.write(fileOut); fileOut.close();
I have the following banks included:
- dom4j-1.6.1
- poi-OOXML-3,5-FINAL
- poi-3.6-20091214
- XMLBeans-2.3.0
- OOXML Schema-1.0
Please let me know what I'm doing wrong here, or I'm missing something.
Vivek source share