mondrian.olap.MondrianException

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.

  • I have a UDF that worked in 2.4 but fails in 3.1.1 with a class cast exception. It expects args[0].evaluate(eval) to return a List, but in 3.1.1 it returns an anonymous iterable from mondrian.rolap.RolapNamedSetEvaluator instead, resulting in a class cast exception. This was originally mentioned in MONDRIAN-588, but I should have provided a better reproduction case. The following test can be added tpo testsrc/main/mondrian/test/UdfTest to demonstrate the problem on the Reverse function: public void testListUdfWithSetArgument() { TestContext tc = TestContext.create( null, null, null, null, "<UserDefinedFunction name=\"Reverse\" className=\"" + ReverseFunction.class.getName() + "\"/>\n", null); tc.assertQueryReturns( "with set [RM] as '[Gender].Members'\n" + "select Reverse([RM]) on 0\n" + "from [Sales]", "Axis #0:\n" + "{}\n" + "Axis #1:\n" + "{[Gender].[All Gender].[M]}\n" + "{[Gender].[All Gender].[F]}\n" + "{[Gender].[All Gender]}\n" + "Row #0: 135,215\n" + "Row #0: 131,558\n" + "Row #0: 266,773\n"); } The resulting error: mondrian.olap.MondrianException: Mondrian Error:Internal error: Error while executing query [with set [RM] as '[Gender].Members' select Reverse([RM]) ON COLUMNS from [Sales] ] at mondrian.resource.MondrianResource$_Def0.ex(MondrianResource.java:811) at mondrian.olap.Util.newInternal(Util.java:1466) at mondrian.olap.Util.newError(Util.java:1482) at mondrian.rolap.RolapConnection.execute(RolapConnection.java:592) at mondrian.test.TestContext.executeQuery(TestContext.java:488) at mondrian.test.TestContext.assertQueryReturns(TestContext.java:915) at mondrian.test.UdfTest.testListUdfWithSetArgument(UdfTest.java:774) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:40) Caused by: java.lang.ClassCastException: mondrian.rolap.RolapNamedSetEvaluator$1 at mondrian.test.UdfTest$ReverseFunction.execute(UdfTest.java:1063) at mondrian.olap.fun.UdfResolver$ListCalcImpl.evaluateList(UdfResolver.java:212) at mondrian.calc.impl.AbstractListCalc.evaluateMemberList(AbstractListCalc.java:84) at mondrian.calc.impl.AbstractExpCompiler$MemberListIterCalc.evaluateMemberIterable(AbstractExpCompiler.java:573) at mondrian.calc.impl.AbstractMemberIterCalc.evaluate(AbstractMemberIterCalc.java:52) at mondrian.rolap.RolapResult.executeAxis(RolapResult.java:745) at mondrian.rolap.RolapResult.evalLoad(RolapResult.java:588) at mondrian.rolap.RolapResult.loadMembers(RolapResult.java:554) at mondrian.rolap.RolapResult.<init>(RolapResult.java:268) at mondrian.rolap.RolapConnection.execute(RolapConnection.java:563) ... 19 more
    via by Eric McDermid,
  • I have a UDF that worked in 2.4 but fails in 3.1.1 with a class cast exception. It expects args[0].evaluate(eval) to return a List, but in 3.1.1 it returns an anonymous iterable from mondrian.rolap.RolapNamedSetEvaluator instead, resulting in a class cast exception. This was originally mentioned in MONDRIAN-588, but I should have provided a better reproduction case. The following test can be added tpo testsrc/main/mondrian/test/UdfTest to demonstrate the problem on the Reverse function: public void testListUdfWithSetArgument() { TestContext tc = TestContext.create( null, null, null, null, "<UserDefinedFunction name=\"Reverse\" className=\"" + ReverseFunction.class.getName() + "\"/>\n", null); tc.assertQueryReturns( "with set [RM] as '[Gender].Members'\n" + "select Reverse([RM]) on 0\n" + "from [Sales]", "Axis #0:\n" + "{}\n" + "Axis #1:\n" + "{[Gender].[All Gender].[M]}\n" + "{[Gender].[All Gender].[F]}\n" + "{[Gender].[All Gender]}\n" + "Row #0: 135,215\n" + "Row #0: 131,558\n" + "Row #0: 266,773\n"); } The resulting error: mondrian.olap.MondrianException: Mondrian Error:Internal error: Error while executing query [with set [RM] as '[Gender].Members' select Reverse([RM]) ON COLUMNS from [Sales] ] at mondrian.resource.MondrianResource$_Def0.ex(MondrianResource.java:811) at mondrian.olap.Util.newInternal(Util.java:1466) at mondrian.olap.Util.newError(Util.java:1482) at mondrian.rolap.RolapConnection.execute(RolapConnection.java:592) at mondrian.test.TestContext.executeQuery(TestContext.java:488) at mondrian.test.TestContext.assertQueryReturns(TestContext.java:915) at mondrian.test.UdfTest.testListUdfWithSetArgument(UdfTest.java:774) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:40) Caused by: java.lang.ClassCastException: mondrian.rolap.RolapNamedSetEvaluator$1 at mondrian.test.UdfTest$ReverseFunction.execute(UdfTest.java:1063) at mondrian.olap.fun.UdfResolver$ListCalcImpl.evaluateList(UdfResolver.java:212) at mondrian.calc.impl.AbstractListCalc.evaluateMemberList(AbstractListCalc.java:84) at mondrian.calc.impl.AbstractExpCompiler$MemberListIterCalc.evaluateMemberIterable(AbstractExpCompiler.java:573) at mondrian.calc.impl.AbstractMemberIterCalc.evaluate(AbstractMemberIterCalc.java:52) at mondrian.rolap.RolapResult.executeAxis(RolapResult.java:745) at mondrian.rolap.RolapResult.evalLoad(RolapResult.java:588) at mondrian.rolap.RolapResult.loadMembers(RolapResult.java:554) at mondrian.rolap.RolapResult.<init>(RolapResult.java:268) at mondrian.rolap.RolapConnection.execute(RolapConnection.java:563) ... 19 more
    via by Eric McDermid,
    • mondrian.olap.MondrianException: Mondrian Error:Internal error: Error while executing query [with set [RM] as '[Gender].Members' select Reverse([RM]) ON COLUMNS from [Sales] ] at mondrian.resource.MondrianResource$_Def0.ex(MondrianResource.java:811) at mondrian.olap.Util.newInternal(Util.java:1466) at mondrian.olap.Util.newError(Util.java:1482) at mondrian.rolap.RolapConnection.execute(RolapConnection.java:592) at mondrian.test.TestContext.executeQuery(TestContext.java:488) at mondrian.test.TestContext.assertQueryReturns(TestContext.java:915) at mondrian.test.UdfTest.testListUdfWithSetArgument(UdfTest.java:774) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:40) Caused by: java.lang.ClassCastException: mondrian.rolap.RolapNamedSetEvaluator$1 at mondrian.test.UdfTest$ReverseFunction.execute(UdfTest.java:1063) at mondrian.olap.fun.UdfResolver$ListCalcImpl.evaluateList(UdfResolver.java:212) at mondrian.calc.impl.AbstractListCalc.evaluateMemberList(AbstractListCalc.java:84) at mondrian.calc.impl.AbstractExpCompiler$MemberListIterCalc.evaluateMemberIterable(AbstractExpCompiler.java:573) at mondrian.calc.impl.AbstractMemberIterCalc.evaluate(AbstractMemberIterCalc.java:52) at mondrian.rolap.RolapResult.executeAxis(RolapResult.java:745) at mondrian.rolap.RolapResult.evalLoad(RolapResult.java:588) at mondrian.rolap.RolapResult.loadMembers(RolapResult.java:554) at mondrian.rolap.RolapResult.<init>(RolapResult.java:268) at mondrian.rolap.RolapConnection.execute(RolapConnection.java:563) ... 11 more
    No Bugmate found.