I am reading an excel sheet in selenium,intellij. I am using the code below and the versions for apache are as;
compile group: 'commons-io', name: 'commons-io', version: '2.5'
compile group: 'org.apache.poi', name: 'poi', version: '3.16'
compile group: 'nz.ac.waikato.cms.weka', name: 'WekaExcel', version:'1.0.5'
i am getting this error;
Exception in thread "main" java.lang.NoSuchMethodError: org.apache.poi.util.POILogger.log(ILjava/lang/Object;)V
public class ExcelRead {
public static void main(String []args) {
try {
// Specify the path of file
File src=new File("/home/mfaheem/WIND/Repository/ecommerce-int/src/ExcelSheets/UserDetail.xlsx");
// load file
FileInputStream fis = new FileInputStream(src);
// Load workbook
XSSFWorkbook wb=new XSSFWorkbook(fis);
// Load sheet- Here we are loading first sheetonly
XSSFSheet sh1= wb.getSheetAt(0);
// getRow() specify which row we want to read.
// and getCell() specify which column to read.
// getStringCellValue() specify that we are reading String data.
System.out.println(sh1.getRow(0).getCell(0).getStringCellValue());
System.out.println(sh1.getRow(0).getCell(1).getStringCellValue());
System.out.println(sh1.getRow(1).getCell(0).getStringCellValue());
} catch (Exception e) {
System.out.println(e.getMessage());
}
}
}