java.lang.ClassCastException: mondrian.mdx.MemberExpr

Pentaho BI Platform Tracking | tmead | 1 decade ago
  1. 0

    When running the following MDX, I receive a class cast exception: String mdx = "with " + " member [Measures].[aa] as '([Measures].[Store Cost],[Gender].[M])'" + " member [Measures].[bb] as '([Measures].[Store Cost],[Gender].[M].PrevMember)'" + " select" + " non empty " + " crossjoin({[Store].[All Stores].[USA].[CA]}," + " {[Measures].[aa], [Measures].[bb]}) on columns," + " non empty " + " [Marital Status].[Marital Status].members on rows" + " from sales"; java.lang.ClassCastException: mondrian.mdx.ResolvedFunCall cannot be cast to mondrian.mdx.MemberExpr at mondrian.rolap.sql.CrossJoinArgFactory.addConstrainingMembersToMap(CrossJoinArgFactory.java:274) at mondrian.rolap.sql.CrossJoinArgFactory.checkConstrainedMeasures(CrossJoinArgFactory.java:207) at mondrian.rolap.sql.CrossJoinArgFactory.checkCrossJoinArg(CrossJoinArgFactory.java:134) at mondrian.rolap.sql.CrossJoinArgFactory.checkCrossJoin(CrossJoinArgFactory.java:391) at mondrian.rolap.sql.CrossJoinArgFactory.checkCrossJoinArg(CrossJoinArgFactory.java:197) at mondrian.rolap.sql.CrossJoinArgFactory.buildConstraintFromAllAxes(CrossJoinArgFactory.java:49) at mondrian.rolap.SqlConstraintFactory.getLevelMembersConstraint(SqlConstraintFactory.java:98) at mondrian.rolap.RolapSchemaReader.getLevelMembers(RolapSchemaReader.java:567) at mondrian.olap.DelegatingSchemaReader.getLevelMembers(DelegatingSchemaReader.java:243) at mondrian.olap.fun.FunUtil.getNonEmptyLevelMembers(FunUtil.java:2201) at mondrian.olap.fun.FunUtil.levelMembers(FunUtil.java:2216) at mondrian.olap.fun.LevelMembersFunDef$1.evaluateList(LevelMembersFunDef.java:37) at mondrian.calc.impl.AbstractListCalc.evaluateIterable(AbstractListCalc.java:71) at mondrian.rolap.RolapResult.executeAxis(RolapResult.java:986) at mondrian.rolap.RolapResult.evalLoad(RolapResult.java:810) at mondrian.rolap.RolapResult.loadMembers(RolapResult.java:766) at mondrian.rolap.RolapResult.<init>(RolapResult.java:411) at mondrian.rolap.RolapConnection.executeInternal(RolapConnection.java:682) ... 8 more The fix was to update CrossJoinArgFactory: private void addConstrainingMembersToMap( Exp arg, Map<Dimension, List<RolapMember>> memberLists) { if (arg instanceof ResolvedFunCall) { ResolvedFunCall call = (ResolvedFunCall) arg; for (Exp callArg : call.getArgs()) { addConstrainingMembersToMap(callArg, memberLists); } } Exp[] tupleArgs = getCalculatedTupleArgs(arg); for (Exp tupleArg : tupleArgs) { Dimension dimension = tupleArg.getType().getDimension(); if (tupleArg instanceof ResolvedFunCall) { addConstrainingMembersToMap(tupleArg, memberLists); } else if (dimension != null && !dimension.isMeasures()) {

    Pentaho BI Platform Tracking | 2 years ago | Will Gorman
    java.lang.ClassCastException: mondrian.mdx.ResolvedFunCall cannot be cast to mondrian.mdx.MemberExpr
  2. 0
    samebug tip
    When you have no build parameters, uncheck 'This build is parameterized'
  3. Speed up your debug routine!

    Automated exception search integrated into your IDE

  4. 0

    WA6 6.1 Applications istalls fine but wont start

    Google Groups | 10 years ago | malin...@capgemini.com
    com.ibm.ejs.container.ContainerEJBException: Failed to stop - caught Throwable
  5. 0

    Screwdriver render Crash

    GitHub | 3 years ago | jem991
    java.lang.ClassCastException: mrtjp.projectred.core.ItemScrewdriver cannot be cast to buildcraft.transport.ItemPipe

    Not finding the right solution?
    Take a tour to get the most out of Samebug.

    Tired of useless tips?

    Automated exception search integrated into your IDE

    Root Cause Analysis

    1. java.lang.ClassCastException

      mondrian.mdx.MemberExpr

      at com.tonbeller.jpivot.mondrian.MondrianUtil$1.handleTreeNode()
    2. com.tonbeller.jpivot
      MondrianUtil$1.handleTreeNode
      1. com.tonbeller.jpivot.mondrian.MondrianUtil$1.handleTreeNode(MondrianUtil.java:308)
      1 frame