This question already has an answer here:
- Exception when writing to the xlsx document several times using apache poi 3.7 7 answers
i'm create a method to write and read work book from file but when i call this method second time. error occure : org.apache.xmlbeans.impl.values.XmlValueDisconnectedException
public XSSFWorkbook GetUpdatedResult(XSSFWorkbook vmworkbookhelper) throws Exception
{
this.vmWorkbookHelper2 = vmworkbookhelper;
String tempName = UUID.randomUUID().toString()+".xlsx";
File tempFile = new File(tempName);
fileOut = new FileOutputStream(tempFile);
this.vmWorkbookHelper2.write(fileOut);
fileOut.close();
vmworkbookhelper = new XSSFWorkbook(tempFile);
if(tempFile.exists())
tempFile.delete();
return vmworkbookhelper;
}