Reputation: 21
I am using poi-3.5-beta5 to read excel file.
I am trying to open excel file through
XSSFWorkbook workBook = new XSSFWorkbook (xlsPath);
i am getting following error (although i am not using log4j)
Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/log4j/Logger at org.apache.poi.openxml4j.opc.Package.(Package.java:63) at org.apache.poi.POIXMLDocument.openPackage(POIXMLDocument.java:63) at org.apache.poi.xssf.usermodel.XSSFWorkbook.(XSSFWorkbook.java:173) at test.ExcelReader.displayFromExcel(ExcelReader.java:44) at test.ExcelReader.main(ExcelReader.java:138)
Please help me to sole this problem. Thanks
Upvotes: 2
Views: 3084
Reputation: 20473
poi-3.5-beta? They have release POI 3.7, it's stable, and powerful. Plus they have a new package called SS (SpreadSheet), it can handdle both HSSF and XSSF files without worrying about type
Details: http://poi.apache.org/spreadsheet/converting.html
Upvotes: 1
Reputation: 2634
If U have that problem still, I want to give you some information:
May be you might not include poi-ooxml-version.jar
file.
Since you're processing Excel format 2007, the XSSF
Format implementations are included in this jar file...
Upvotes: 0
Reputation: 5761
POI probably has a dependency on log4j. Just include the log4j jar in your classpath.
Upvotes: 3