java.lang.IndexOutOfBoundsException: Cell ordinal 8) lies outside CellSet bounds (2, 4)

There are no available Samebug tips for this exception. Do you have an idea how to solve this issue? A short tip would help users who saw this issue last week.

  • Hi! I'm using an embedded Mondrian 3.6.1 together with Pivot4J 0.9 to build a very simple OLAP web application. When performing drill through operations an exception occurs if a cell is addressed with its ordinal number and a NonEmpty clause is present in the MDX statement. In my case, the exception occurs because the ordinal number references a Cell that is beyond the dimensions of the result. However, the problem also exists for ordinal numbers within the given range as a wrong cell could be returned by CellSet.getCell(int). By default, the Pivot4J API uses the Cell ordinal as parameter to identify the cell to drill through in subsequent requests. If there is no NonEmpty clause everything works fine. A dump of a result with 2 columns and 6 rows prints the following cell coordinates and their ordinals: [0, 0] 0 [1, 0] 1 [0, 1] 2 [1, 1] 3 [0, 2] 4 [1, 2] 5 [0, 3] 6 [1, 3] 7 [0, 4] 8 [1, 4] 9 [0, 5] 10 [1, 5] 11 If I include a NonEmpty clause in the same statement, the cell coordinates are correct, but the ordinal numbers are not changed. In this example the rows with number 1 and 3 are empty. [0, 0] 0 [1, 0] 1 [0, 1] 4 [1, 1] 5 [0, 2] 8 [1, 2] 9 [0, 3] 10 [1, 3] 11 However, if I call MondrianOlap4JCellSet.getCell(8) the operation results in an exception: java.lang.IndexOutOfBoundsException: Cell ordinal 8) lies outside CellSet bounds (2, 4) at mondrian.olap4j.MondrianOlap4jCellSet.ordinalToCoordinateArray(MondrianOlap4jCellSet.java:152) at mondrian.olap4j.MondrianOlap4jCellSet.getCell(MondrianOlap4jCellSet.java:138) Looking into the code some more, the first call to MondrianOlap4JCell.getOrdinal() finally results in mondrian.rolap.RolapResult.getCellOrdinal(int[]) being called. This results *includes* the empty rows. The later call to MondrianOlap4JCellSet.getCell(int) uses the private method int[] ordinalToCoordinateArray(int) to compute the coordinates. In this method result.getAxes() is used to get the axes and their sizes. However, the instance of "result" is RolapConnection$NonEmptyResult(ResultBase) and this result no longer contains the empty rows. Thus, the ordinal 8 is out of range. I think that MondrianOlap4JCell.getOrdinal() should not compute the ordinal number on the result that includes the empty rows.
    via by Prohaska Andreas,
  • Hi! I'm using an embedded Mondrian 3.6.1 together with Pivot4J 0.9 to build a very simple OLAP web application. When performing drill through operations an exception occurs if a cell is addressed with its ordinal number and a NonEmpty clause is present in the MDX statement. In my case, the exception occurs because the ordinal number references a Cell that is beyond the dimensions of the result. However, the problem also exists for ordinal numbers within the given range as a wrong cell could be returned by CellSet.getCell(int). By default, the Pivot4J API uses the Cell ordinal as parameter to identify the cell to drill through in subsequent requests. If there is no NonEmpty clause everything works fine. A dump of a result with 2 columns and 6 rows prints the following cell coordinates and their ordinals: [0, 0] 0 [1, 0] 1 [0, 1] 2 [1, 1] 3 [0, 2] 4 [1, 2] 5 [0, 3] 6 [1, 3] 7 [0, 4] 8 [1, 4] 9 [0, 5] 10 [1, 5] 11 If I include a NonEmpty clause in the same statement, the cell coordinates are correct, but the ordinal numbers are not changed. In this example the rows with number 1 and 3 are empty. [0, 0] 0 [1, 0] 1 [0, 1] 4 [1, 1] 5 [0, 2] 8 [1, 2] 9 [0, 3] 10 [1, 3] 11 However, if I call MondrianOlap4JCellSet.getCell(8) the operation results in an exception: java.lang.IndexOutOfBoundsException: Cell ordinal 8) lies outside CellSet bounds (2, 4) at mondrian.olap4j.MondrianOlap4jCellSet.ordinalToCoordinateArray(MondrianOlap4jCellSet.java:152) at mondrian.olap4j.MondrianOlap4jCellSet.getCell(MondrianOlap4jCellSet.java:138) Looking into the code some more, the first call to MondrianOlap4JCell.getOrdinal() finally results in mondrian.rolap.RolapResult.getCellOrdinal(int[]) being called. This results *includes* the empty rows. The later call to MondrianOlap4JCellSet.getCell(int) uses the private method int[] ordinalToCoordinateArray(int) to compute the coordinates. In this method result.getAxes() is used to get the axes and their sizes. However, the instance of "result" is RolapConnection$NonEmptyResult(ResultBase) and this result no longer contains the empty rows. Thus, the ordinal 8 is out of range. I think that MondrianOlap4JCell.getOrdinal() should not compute the ordinal number on the result that includes the empty rows.
    via by Prohaska Andreas,
    • java.lang.IndexOutOfBoundsException: Cell ordinal 8) lies outside CellSet bounds (2, 4) at mondrian.olap4j.MondrianOlap4jCellSet.ordinalToCoordinateArray(MondrianOlap4jCellSet.java:152) at mondrian.olap4j.MondrianOlap4jCellSet.getCell(MondrianOlap4jCellSet.java:138)
    No Bugmate found.