We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

NPE at com.aspose.cells.zbor.i using .Cells for Java

I’m currently getting a NullPointerException when trying to open one of my SpreadsheetML reports. At the moment, I’m using the “aspose-cells-21.11.7.jar” patched build w/ a temporary license that I was given to resolve another issue I was having with Excel itself throwing errors when opening an Aspose-converted XLSX file. This build resolves that issue for that particular report.

But this other report, I’m getting an NPE exception in Java at the point it’s trying to open the SpreadsheetML file.

Here is the snippet of the code:

	    com.aspose.cells.License license = new com.aspose.cells.License();
	    license.setLicense(new java.io.FileInputStream("c:\\process\\Aspose.Cells.Java.lic"));

	    FileOutputStream fos2 = new FileOutputStream(thefile.internalName());
	    Workbook wb = new Workbook(excelXmlFile, new LoadOptions(LoadFormat.SPREADSHEET_ML)); // This is where it's failing. "excelXmlFile" is a string path to the SpreadsheetML file
	    wb.save(fos2, SaveFormat.EXCEL_97_TO_2003);
	    fos2.close();

I’ve also tried using the “new Workbook(excelXmlFile)” constructor with the same exception:

Caused by: java.lang.NullPointerException
	at com.aspose.cells.zbor.i(Unknown Source)
	at com.aspose.cells.zbor.h(Unknown Source)
	at com.aspose.cells.zbor.a(Unknown Source)
	at com.aspose.cells.zbor.a(Unknown Source)
	at com.aspose.cells.zkn.a(Unknown Source)
	at com.aspose.cells.Workbook.a(Unknown Source)
	at com.aspose.cells.Workbook.<init>(Unknown Source)

Attached should be a sample of the SpreadsheetML I’m trying to convert to EXCEL_97_TO_2003 format this time.

Thank you,
Jay Horita

Sample SpreadsheetML file.zip (3.6 KB)

@imkookoo

Thanks for the resource files.
We have reproduced the issue and logged a ticket with an id “CELLJAVA-44104” for it. We will fix it and provide patch for you soon.

@imkookoo,
Please try our latest fix:
aspose-cells-21.11.8-java.zip (7.5 MB)

Thank you, Johnson. The fix worked.

Best regards,
Jay

@imkookoo,

Thanks for your feedback.

Good to know that your issue is resolved by using the new fix. Feel free to contact us any time if you need further help or have some other issue or queries, we will be happy to assist you soon.

The issues you have found earlier (filed as CELLSJAVA-44104) have been fixed in this update. This message was posted using Bugs notification tool