Hello. We caught a bug in Aspose.Cells 20.3 (it also produces in 20.4) with loading XLSM file with large sheet.
Stacktrace (Aspose.Cells 20.4):
Exception in thread "main" java.io.IOException: Invalid stream settings, cannot get entry [docProps/core.xml]
at com.aspose.cells.a.f.zg.c(Unknown Source)
at com.aspose.cells.a.f.zj.a(Unknown Source)
at com.aspose.cells.zbcm.a(Unknown Source)
at com.aspose.cells.ze.t(Unknown Source)
at com.aspose.cells.ze.a(Unknown Source)
at com.aspose.cells.zaql.a(Unknown Source)
at com.aspose.cells.zjy.a(Unknown Source)
at com.aspose.cells.zjy.a(Unknown Source)
at com.aspose.cells.Workbook.a(Unknown Source)
at com.aspose.cells.Workbook.<init>(Unknown Source)
at LargeTemplateMain.main(LargeTemplateMain.java:18)
Code snippet:
public class LargeTemplateMain {
public static void main(String[] args) throws Exception {
License license = new License();
license.setLicense("aspose.lic");
FileInputStream fileInputStream = new FileInputStream("LargeTemplateTest.xlsm");
ByteArrayInputStream byteArrayInputStream = new ByteArrayInputStream(IOUtils.toByteArray(fileInputStream));
new Workbook(byteArrayInputStream);
}
}
Code snippet 2 (bug not reproducing because another stream type used):
public class LargeTemplateMain {
public static void main(String[] args) throws Exception {
License license = new License();
license.setLicense("aspose.lic");
FileInputStream fileInputStream = new FileInputStream("LargeTemplateTest.xlsm");
new Workbook(fileInputStream);
}
}
I can’t attach template because it’s private and I have no permissions for do this.
After further investigation I found that problem caused by InputStream with markSupported()==true
.
As workaround I found that we can wrap our InputStream to another which return false in markSupported
method. But we worried that with this workaround we get new problems with increased memory consumption. What do you think about this?
P.S. This error start cause for us after upgrade 19.10 --> 20.3
P.S. We caught this bug on Java 8 (production environment) and I reproduced it on Java 11 at local station.