vendredi 20 février 2015

Multithreading in Apache POI WorkBooK


Vote count:

0




I want to write into HSSFWorkBook or XSSFWorkBook in Multhreading environment. Each thread will do the modification in same or different sheet.



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());
}


While testing this code in LoadTest with MultiThreading in SOAPUI. I got the exception in line



Workbook workbook = new XSSFWorkbook(fileInputStream);


The exception is as follows



org.apache.poi.POIXMLException: org.apache.poi.openxml4j.exceptions.InvalidFormatException: Package should contain a content type part [M1.13]


Thanks in advance.



asked 1 min ago







Multithreading in Apache POI WorkBooK

Aucun commentaire:

Enregistrer un commentaire