NPE calling com.aspose.cells.Row

I need to create Excel files, and convert them to PDF reports, and have downloaded cells 8.6.1 for evaluation.
It worries me, that I'm getting internal NullPointerExceptions. It doesn't matter that method i call the Row object. They all throw this exception. Please explain. Am I doing something wrong, or is this a bug?

-------------------------------------------------------------------------------
Test set: dk.flsmidth.TestRepDay
-------------------------------------------------------------------------------
Tests run: 1, Failures: 1, Errors: 0, Skipped: 0, Time elapsed: 5.934 sec <<< FAILURE!
TestRepDay(dk.flsmidth.TestRepDay) Time elapsed: 4.217 sec <<< FAILURE!
java.lang.NullPointerException
at com.aspose.cells.zbbd$zb.f(Unknown Source)
at com.aspose.cells.Row.b(Unknown Source)
at com.aspose.cells.Row.iterator(Unknown Source)

Hi Kenneth,


Thank you for contacting Aspose support.

I am afraid, we require your exact code (preferably a sample application) along with the template spreadsheet (if any) to properly investigate the matter on our side. Before you move forward, please give the latest version of Aspose.Cells for Java 8.6.1.2 a try on your side to see if it makes any difference.

It’s easy to create the error:

public void testCells(){
Workbook workbook = new Workbook();
Worksheet sheet = workbook.getWorksheets().get(0);
sheet.getCells().getRows().getRowByIndex(0).iterator();
}

Output:
java.lang.NullPointerException
at com.aspose.cells.zbbd$zb.f(Unknown Source)
at com.aspose.cells.Row.b(Unknown Source)
at com.aspose.cells.Row.iterator(Unknown Source)
at dk.flsmidth.TestRepDay.testCells(TestRepDay.java:45)

I can’t test version 8.6.2.1, as it’s not available in your maven repository…

Hi Kenneth,

Thanks for providing us a simple sample code to replicate the exception and using Aspose.Cells.

We were able to replicate the exception using the latest version: Aspose.Cells
for Java v8.6.1.2
with your sample code. However, this might not be a bug. You may need a code change. We have therefore logged this issue in our database for investigation. We will look into it and fix this issue in case it is a bug or suggest you a code change. Once, there is some fix or other news for you, we will let you know asap.

This issue has been logged as

  • CELLSJAVA-41564 - NullPointerExceptions calling com.aspose.cells.Row

Hi again,


This is to update you that the ticket logged earlier as CELLSJAVA-41564 has been marked resolved. Please note, with next revision of the Aspose.Cella APIs if there is no Row object in the position, RowCollection.getRowByIndex() will return null.

The issues you have found earlier (filed as CELLSJAVA-41564) have been fixed in this update.


This message was posted using Notification2Forum from Downloads module by Aspose Notifier.