java - org.apache.xmlbeans.impl.values.XmlValueDisconnectedException when write workbook twice -


i'm create method write , read work book file when call 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; } 

agree akokskis, writing twice causing problem, can try reloading again workbook after writing, work. example

    fileoutputstream fileout = new fileoutputstream("workbook.xlsx");     wb.write(fileout);     fileout.close();     wb = new xssfworkbook(new fileinputstream("workbook.xlsx")); 

Comments

Popular posts from this blog

c# - Send Image in Json : 400 Bad request -

javascript - addthis share facebook and google+ url -

ios - Show keyboard with UITextField in the input accessory view -