Below are the set of Jar used

below is my Заглушка: < /p>
import java.io.File;
import java.io.FileInputStream;
import java.util.Iterator;
import org.apache.poi.ss.usermodel.Cell;
import org.apache.poi.ss.usermodel.Row;
import org.apache.poi.xssf.usermodel.XSSFSheet;
import org.apache.poi.xssf.usermodel.XSSFWorkbook;
public class ReadExcelDemo
{
public static void main(String[] args)
{
try
{
FileInputStream file = new FileInputStream(new File("D:\\TemporaryUploadContainer\\61C50E5C2395C7FB48499BCFDD797F15_QuickCartExample.xlsx"));
//Workbook workbook1 = WorkbookFactory.create(file);
//Sheet sheet1 = workbook1.getSheetAt(0);
XSSFWorkbook workbook = new XSSFWorkbook(file);
XSSFSheet sheet = workbook.getSheetAt(0);
//Iterate through each rows one by one
Iterator rowIterator = sheet.iterator();
while (rowIterator.hasNext())
{
Row row = rowIterator.next();
//For each row, iterate through all the columns
Iterator cellIterator = row.cellIterator();
while (cellIterator.hasNext())
{
Cell cell = cellIterator.next();
//Check the cell type and format accordingly
switch (cell.getCellType())
{
case NUMERIC:
System.out.print(cell.getNumericCellValue() + "t");
break;
case STRING:
System.out.print(cell.getStringCellValue() + "t");
break;
}
}
System.out.println("");
}
file.close();
}
catch (Exception e)
{
e.printStackTrace();
}
}
}
< /code>
ниже ошибки для < /strong>: Workbook Workbook1 = WorkbookFactory.create (file); < /code> < /p>
Исключение в потоке "main" java.lang.nosuchfielderror: factory
at at thread. org.apache.poi.xssf.model.themestable. (themestable.java:86)
at org.apache.poi.ooxml.poixmlfactory.createdocumentpart (poixmlfactory.java:61)
at org.apache.poi.ooxml.poixmldocumentpart.read (poixmldocumentpart.java:661)
at org.apache.poi.ooxml.poixmldocument.load (poixmldocument.java:165)
at org.apache.poi.xssf.usermodel.xssfworkbook. (xssfworkbook.java:275)
at org.apache.poi.xssf.usermodel.xssfwork. test.XLSXReaderWriterP21.readRecordsFromFile(XLSXReaderWriterP21.java:76)
at test.XLSXReaderWriterP21.main(XLSXReaderWriterP21.java:57)
Below Error for : Xssfworkbook Workbook = new xssfworkbook (file); < /code> < /p>
Исключение в потоке "main" java.lang.nosuchfielderror: factory
at org.apache.poi.xssf.model.themestable. org.apache.poi.ooxml.poixmlfactory.createdocumentpart (poixmlfactory.java:61)
at org.apache.poi.ooxml.poixmldocumentpart.read (poixmldocumentpart.java:661)
att org.apache.poi.ooxml.poixmldocument.load (poixmldocument.java:165)
at org.apache.poi.xssf.usermodel.xssfworkbook. org.apache.poi.xssf.usermodel.xssfworkbook. (xssfworkbook.java:296)
at test.readexceldemo.main (readexceldemo.java:26) < /p>
< /blockquote.>
Подробнее здесь: https://stackoverflow.com/questions/706 ... or-factory