java.lang.ClassNotFoundException: org.apache.xmlbeans.XmlException

Afin de lire un xlsx fichier que je suis en utilisant apache POI, j'ai téléchargé le zip et placé à la suite de jsr dans ma servlet emplacement webcontent/web-inf/lib et configuré le chemin de génération par le biais de l'éclipse

java.lang.ClassNotFoundException: org.apache.xmlbeans.XmlException

et mon code se présente comme suit,

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;

File uploadedFile = new File(fpath, fileName);
item.write(uploadedFile);
String mimeType = (Files.probeContentType(uploadedFile.toPath())).toString();
System.out.println(mimeType);
if(mimeType.equals("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"))
{
FileInputStream file = new FileInputStream(uploadedFile);
    XSSFWorkbook workbook = new XSSFWorkbook(file);
    for (int i =0; i < workbook.getNumberOfSheets(); i++)
    {
       XSSFSheet sheet = workbook.getSheetAt(i);
       Iterator<Row> row = sheet.iterator();
       while(row.hasNext()) {
   Iterator<Cell> cellIterator = ((Row) row).cellIterator();
       while(cellIterator.hasNext()) {
       Cell cell1 = cellIterator.next();
       switch(cell1.getCellType()) 
         {
    case Cell.CELL_TYPE_BOOLEAN:
    System.out.print(cell1.getBooleanCellValue() + "\n");
    break;
    case Cell.CELL_TYPE_NUMERIC:
    System.out.print(cell1.getNumericCellValue() + "\n");
    break;
    case Cell.CELL_TYPE_STRING:
    System.out.print(cell1.getStringCellValue() + "\n");
    break;
    }
     }

Bien qu'ils ne le montrent pas et les erreurs sur eclipse, il montre les erreurs suivantes lorsque j'essaie d'exécuter le code

java.lang.ClassNotFoundException: org.apache.xmlbeans.XmlException

Quelle est mon erreur? Comment résoudre ce problème?

source d'informationauteur