我希望在多线程环境下将数据写入HSSFWorkBook或XSSFWorkBook。每个线程将会在同一个或不同的工作表中进行修改。
try {
String filePath="C:/Test.xlsx";
FileInputStream fileInputStream = new FileInputStream(filePath);
Workbook workbook = new XSSFWorkbook(fileInputStream);
FileOutputStream fos = new FileOutputStream(filePath);
workbook.write(fos);
fos.close();
fileInputStream.close();
} catch(Exception e) {
e.printStackTrace();
System.out.println(e.getMessage());
}
在SOAPUI中使用MultiThreading进行LoadTest测试时,我在以下行代码处遇到了异常:
Workbook workbook = new XSSFWorkbook(fileInputStream);
异常情况如下所示:
org.apache.poi.POIXMLException: org.apache.poi.openxml4j.exceptions.InvalidFormatException: Package should contain a content type part [M1.13]