我有艰难的时间去阅读我使用XSSF从Excel的一个特定的单元中读取数据,但一直得到错误从Excel 2007中的数据 -
Exception in thread "main" java.lang.NoSuchMethodError: org.apache.xmlbeans.XmlOptions.setSaveAggressiveNamespaces()Lorg/apache/xmlbeans/XmlOptions; at org.apache.poi.POIXMLDocumentPart.(POIXMLDocumentPart.java:46)
这是我的代码:
public static void main(String [] args) throws IOException {
InputStream ins = new FileInputStream("C:\\Users\\Tarun3Kumar\\Desktop\\test.xlsx");
XSSFWorkbook xwb = new XSSFWorkbook(ins);
XSSFSheet sheet = xwb.getSheetAt(0);
Row row = sheet.getRow(1);
Cell cell = row.getCell(0);
System.out.println(cell.getStringCellValue());
System.out.println("a");
}
我有以下添加到构建路径罐子 -
poi-3.6 poi-ooxml-3.6 poi-ooxml-schemas-3.6 x-bean.jar
我只能弄清楚, setSaveAggressiveNamespaces
已经取代setSaveAggresiveNamespaces
....