I am trying ti read the .xlsx file from eclipse using the maven project.
Here all the dependencies I am using
code for reading the excel file
Workbook workBook = WorkbookFactory.create(new File(SourceFile));
Sheet metadataSheet = workBook.getSheet(SheetName);
Its returning the exception. "org.apache.poi.openxml4j.exceptions.InvalidFormatException: Can't read content types part !"
I have tried by using this code as well
XSSFWorkbook workbook = new XSSFWorkbook(excelFile);
XSSFSheet metadataSheet = workbook.getSheet(SheetName)
it is returning this exception " org.apache.sling.engine.impl.SlingRequestProcessorImpl service: Uncaught Throwable
java.lang.NullPointerException: in is null"
Please guide me or advice how to resolve this.
I have tried using the jxl java API , I am able to read the .xls but not able to read .xlsx by using this.
Thanks In Advance
I am facing the problem with POI as well. I have given the details of code and decencies using in it.
POI is working with beans project but with maven I am seeing the exceptions.
I am not sure what is missing in it.