Eclipse で Selenium JUni4 Web ドライバーを使用して Excel ファイルを開こうとすると、次のエラーが発生します。エラーとコードを以下に示します。私はJAVAが初めてです。助けてください。
public void xlRead_TC(String sPath, int sSheet) throws Exception{
//Workbook book = Workbook.createWorkbook(f);
System.out.println("Step 1B - Opening excel files Reached");
File myxl = new File(sPath);
FileInputStream myStream = new FileInputStream(myxl);
//Workbook w;
//w = Workbook.getWorkbook(myStream);
XSSFWorkbook myWB = new XSSFWorkbook(myStream);
//XSSFSheet mySheet = myWB.getSheetAt(sSheet); // Referring to 1st sheet
//xRows_Inp = mySheet.getLastRowNum()+1;
//xCols_Inp = mySheet.getRow(0).getLastCellNum();
System.out.println("Rows are " + xRows_Inp);
System.out.println("Cols are " + xCols_Inp);
//Workbook[] wbs = new Workbook[] { new HSSFWorkbook(), new XSSFWorkbook() };
//xRows_TC = mySheet.getLastRowNum()+1;
//xCols_TC = mySheet.getRow(0).getLastCellNum();
//System.out.println("Rows are " + xRows_TC);
//System.out.println("Cols are " + xCols_TC);
//xData_TC = new String[xRows_TC][xCols_TC];
}
例外
java.lang.NoClassDefFoundError: org/dom4j/DocumentException
at org.apache.poi.openxml4j.opc.OPCPackage.init(OPCPackage.java:154)
at org.apache.poi.openxml4j.opc.OPCPackage.<init>(OPCPackage.java:141)
at org.apache.poi.openxml4j.opc.Package.<init>(Package.java:54)