NPE when loading XLSB workbook with LightCellsDataHandler

Hi,

Using Aspose Cells for Java, version 24.5.

Sample code:

InputStream xlsbInputStream = new BufferedInputStream(new FileInputStream("input.xlsb"));
LoadOptions loadOptions = new LoadOptions();
loadOptions.setMemorySetting(MemorySetting.MEMORY_PREFERENCE);
loadOptions.setKeepUnparsedData(false);
loadOptions.setParsingFormulaOnOpen(false);
loadOptions.setLightCellsDataHandler(new LightCellsDataHandler() {
    @Override
    public boolean startSheet(Worksheet worksheet) {
        return true;
    }

    @Override
    public boolean startRow(int i) {
        return true;
    }

    @Override
    public boolean processRow(Row row) {
        return false;
    }

    @Override
    public boolean startCell(int i) {
        return true;
    }

    @Override
    public boolean processCell(Cell cell) {
        return true;
    }
});

Workbook workbook = new Workbook(xlsbInputStream, loadOptions);

Resulting exception stacktrace:

Exception in thread "main" java.lang.NullPointerException
	at com.aspose.cells.je.a(Unknown Source)
	at com.aspose.cells.dhp.b(Unknown Source)
	at com.aspose.cells.dhp.a(Unknown Source)
	at com.aspose.cells.dhp.z(Unknown Source)
	at com.aspose.cells.dhp.a(Unknown Source)
	at com.aspose.cells.dfu.a(Unknown Source)
	at com.aspose.cells.g.e(Unknown Source)
	at com.aspose.cells.g.w(Unknown Source)
	at com.aspose.cells.g.a(Unknown Source)
	at com.aspose.cells.auq.a(Unknown Source)
	at com.aspose.cells.jy.a(Unknown Source)
	at com.aspose.cells.jy.a(Unknown Source)
	at com.aspose.cells.Workbook.a(Unknown Source)
	at com.aspose.cells.Workbook.<init>(Unknown Source)
	at <repro case>

input.zip (9.0 KB)

Kind regards,
Taras

@TarasTielkes,

Thanks for the template XLSB file and details.

After an initial test, I am able to reproduce the issue as you mentioned by using your template XLSB file and sample code segment. I found NPE (java.lang.NullPointerException) when loading XLSB workbook in light-weight mode. It works fine if we load the file in normal mode though.

We require thorough evaluation of the issue. We have opened the following new ticket(s) in our internal issue tracking system and will deliver their fixes according to the terms mentioned in Free Support Policies.

Issue ID(s): CELLSJAVA-45994

You can obtain Paid Support Services if you need support on a priority basis, along with the direct access to our Paid Support management team.

Any update on what is the root cause that is triggering this exception?

@TarasTielkes,

Apologies, but we have not yet evaluated or investigated your issue. We hope to analyze the problem in the coming days and will provide you with an update.

@TarasTielkes,

We are pleased to inform you that your issue (logged as “CELLSJAVA-45994”) has been resolved. The fix will be included in an upcoming release (Aspose.Cells v24.6) that we plan to release either this week or early next week. You will be notified when the next version is released.

1 Like

The issues you have found earlier (filed as CELLSJAVA-45994) have been fixed in Aspose.Cells for Java 24.6.

1 Like