1

Apache POI で XLSX ファイルを読み込もうとしていますが、ファイルを読み込めません。以下に示すコードでこのエラーが発生しました。

A sheet hyperlink must either have a location, or a relationship

私が間違っている場所を特定するのを手伝ってください:

public void readFile() throws Exception {       
    String filePath="/home/work1/DATA FEB/MANI-FINAL/ENGG-1.xlsx";
    XSSFWorkbook workbook = new XSSFWorkbook(new FileInputStream(filePath));
    sheet = workbook.getSheetAt(0);
}

そして、ここにスタックトレースがあります:

Exception in thread "main" java.lang.IllegalStateException: A sheet hyperlink must either have a location, or a relationship. Found:
<xml-fragment ref="J502:J503" xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships" xmlns:xdr="http://schemas.openxmlformats.org/drawingml/2006/spreadsheetDrawing" xmlns:x14="http://schemas.microsoft.com/office/spreadsheetml/2009/9/main" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:x14ac="http://schemas.microsoft.com/office/spreadsheetml/2009/9/ac"/>
    at org.apache.poi.xssf.usermodel.XSSFHyperlink.<init>(XSSFHyperlink.java:72)
    at org.apache.poi.xssf.usermodel.XSSFSheet.initHyperlinks(XSSFSheet.java:182)
    at org.apache.poi.xssf.usermodel.XSSFSheet.read(XSSFSheet.java:139)
    at org.apache.poi.xssf.usermodel.XSSFSheet.onDocumentRead(XSSFSheet.java:119)
    at org.apache.poi.xssf.usermodel.XSSFWorkbook.onDocumentRead(XSSFWorkbook.java:222)
    at org.apache.poi.POIXMLDocument.load(POIXMLDocument.java:200)
    at org.apache.poi.xssf.usermodel.XSSFWorkbook.<init>(XSSFWorkbook.java:179)
4

0 に答える 0