i'm trying for the first time the apache poi library to manage Execel files. I follow this steps to import apache poi: Import Apache POI in Intellij for JAVA. The code compile without error but when i run it give me this error messages:
Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/xmlbeans/XmlObject at Test.main(Test.java:16) Caused by: java.lang.ClassNotFoundException: org.apache.xmlbeans.XmlObject at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:636) at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:182) at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:519) ... 1 more
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
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 Test {
    public static void main(String[] args) {
        try {
            File file = new File("C:\\Users\\Huawei\\IdeaProjects\\untitled\\src\\TEST.xlsx");
            FileInputStream fis = new FileInputStream(file);
            XSSFWorkbook wb = new XSSFWorkbook(fis);
            XSSFSheet sheet = wb.getSheetAt(0);
            Iterator<Row> itr = sheet.iterator();
            while(itr.hasNext()){
                Row row = itr.next();
                Iterator<Cell> celliterator = row.cellIterator();
                while(celliterator.hasNext()){
                    Cell cell = celliterator.next();
                    switch (cell.getCellType()){
                        case STRING:    //field that represents string cell type
                            System.out.print(cell.getStringCellValue() + "\t\t\t");
                            break;
                        case NUMERIC:    //field that represents number cell type
                            System.out.print(cell.getNumericCellValue() + "\t\t\t");
                            break;
                        default:
                            System.out.println("NOT NUMERIC AND NOT STRING");
                    }
                }
            }
        }catch (Exception e ){
            e.printStackTrace();
        }
        }
    }
 
    