gpt4 book ai didi

file-io - org.apache.poi.openxml4j.exceptions.OpenXML4JRuntimeException : Fail to save

转载 作者:行者123 更新时间:2023-12-04 10:39:15 34 4
gpt4 key购买 nike

我面对org.apache.poi.openxml4j.exceptions.OpenXML4JRuntimeException: Fail to save:an error occurs while saving the package : The part /docProps/app.xml fail to be saved in the stream with marshaller <br/> org.apache.poi.openxml4j.opc.internal.marshallers.DefaultMarshaller@7c81475b
在每个测试场景执行完成后尝试将每个测试场景结果(PASS 或 FAIL)写入 Excel 表(.xlsx)时出现异常。为此,我编写了以下两个不同的模块。

请告诉我问题出在哪里以及如何解决它..

//Method for writing results into Report
public void putResultstoReport(String values[])
{
int j=NoofTimesExecuted;
NoofTimesExecuted++;
XSSFRow row = sheet.createRow(j);
for(int i=0;i<values.length;i++)
{
XSSFCell cell = row.createCell(i);
cell.setCellValue(values[i]);
}
try {
System.out.println("Times:"+NoofTimesExecuted);
wb.write(fileOut);
}
//fileOut.flush();
//fileOut.close();
}
catch(Exception e) {
System.out.println("Exception at closing opened Report :"+e);
}

//Method for Creating the Excelt Report
public void createReport()
{
String FileLocation = getProperty("WorkSpace")+"//SCH_Registration//OutPut//TestResults.xlsx";
try {
fileOut = new FileOutputStream(FileLocation);
String sheetName = "TestResults"; //name of sheet
wb = new XSSFWorkbook();
sheet = wb.createSheet(sheetName);
fileOut.flush();
fileOut.close();
}
catch(Exception e)
{
System.out.println("Exception at Create Report file:"+e);
}
}

最佳答案

如果发生超时,可能会发生这种情况。我有适用于小型数据集的代码,并在大型数据集上引发此错误。

关于file-io - org.apache.poi.openxml4j.exceptions.OpenXML4JRuntimeException : Fail to save,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19810214/

34 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com