Pentaho BA Platform
  1. Pentaho BA Platform
  2. BISERVER-394

JPivot is croaking on StrToMember and CurrentDateMember functions

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Severe Severe
    • Resolution: Fixed
    • Affects Version/s: Pentaho 1.6 RC 2
    • Fix Version/s: Pentaho 1.6 GA
    • Component/s: Analysis
    • Labels:
      None
    • Notice:
      When an issue is open, the "Fix Version/s" field conveys a target, not necessarily a commitment. When an issue is closed, the "Fix Version/s" field conveys the version that the issue was fixed in.

      Description

      JPivot is throwing a Null Pointer exception when using an MDX Function that returns a member. This is critical for CurrentDateMember/StrToMember to work properly.

      Using SteelWheels.

      This works:
      select

      {[Measures].[Sales]} ON COLUMNS,
      {[Time].[All Years].[2003]} ON ROWS
      from [SteelWheelsSales]

      This throws a NullPointer exception:
      select {[Measures].[Sales]}

      ON COLUMNS,

      {StrToMember('[Time].[All Years].[2003]')}

      ON ROWS
      from [SteelWheelsSales]

      The NullPointer isn't in Mondrian classes it's in JPivot. I've attached an MDXLookup version that is using the same MDX query and it works. In other words, the MDX is sound and MDXLookup can execute it no problem but JPivot is throwing exceptions.

      2007-10-02 11:44:26,631 ERROR [com.tonbeller.wcf.controller.RequestFilter] exeption
      com.tonbeller.wcf.utils.SoftException: java.lang.NullPointerException
      at com.tonbeller.wcf.convert.ConverterImpl.traverse(ConverterImpl.java:102)
      at com.tonbeller.wcf.convert.ConverterImpl.traverse(ConverterImpl.java:111)
      at com.tonbeller.wcf.convert.ConverterImpl.traverse(ConverterImpl.java:111)
      at com.tonbeller.wcf.convert.ConverterImpl.traverse(ConverterImpl.java:111)
      at com.tonbeller.wcf.convert.ConverterImpl.traverse(ConverterImpl.java:111)
      at com.tonbeller.wcf.convert.ConverterImpl.traverse(ConverterImpl.java:111)
      at com.tonbeller.wcf.convert.ConverterImpl.validate(ConverterImpl.java:65)
      at com.tonbeller.wcf.form.FormComponent.validate(FormComponent.java:100)
      at com.tonbeller.wcf.form.ButtonHandler.request(ButtonHandler.java:94)
      at com.tonbeller.wcf.controller.DispatcherSupport.request(DispatcherSupport.java:167)
      at com.tonbeller.wcf.component.ComponentSupport.request(ComponentSupport.java:104)
      at com.tonbeller.wcf.controller.WcfController.request(WcfController.java:71)
      at com.tonbeller.wcf.controller.RequestFilter$MyHandler.normalRequest(RequestFilter.java:119)
      at com.tonbeller.wcf.controller.RequestSynchronizer.handleRequest(RequestSynchronizer.java:127)
      at com.tonbeller.wcf.controller.RequestFilter.doFilter(RequestFilter.java:263)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
      at org.pentaho.core.system.SystemStatusFilter.doFilter(SystemStatusFilter.java:53)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
      at org.pentaho.ui.servlet.SetCharacterEncodingFilter.doFilter(SetCharacterEncodingFilter.java:112)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
      at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
      at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:230)
      at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
      at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:179)
      at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:84)
      at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
      at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:104)
      at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:157)
      at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
      at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:241)
      at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
      at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:580)
      at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
      at java.lang.Thread.run(Thread.java:595)
      Caused by: java.lang.NullPointerException
      at com.tonbeller.jpivot.mondrian.MondrianQueryAdapter.<init>(MondrianQueryAdapter.java:64)
      at com.tonbeller.jpivot.mondrian.MondrianModel.setUserMdx(MondrianModel.java:835)
      at com.tonbeller.jpivot.mondrian.MondrianMdxQuery.setMdxQuery(MondrianMdxQuery.java:45)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:585)
      at org.apache.commons.beanutils.PropertyUtilsBean.invokeMethod(PropertyUtilsBean.java:1773)
      at org.apache.commons.beanutils.PropertyUtilsBean.setSimpleProperty(PropertyUtilsBean.java:1759)
      at org.apache.commons.beanutils.PropertyUtilsBean.setNestedProperty(PropertyUtilsBean.java:1648)
      at org.apache.commons.beanutils.PropertyUtilsBean.setProperty(PropertyUtilsBean.java:1677)
      at org.apache.commons.beanutils.PropertyUtils.setProperty(PropertyUtils.java:559)
      at com.tonbeller.wcf.convert.EditCtrlConverter.convert(EditCtrlConverter.java:72)
      at com.tonbeller.wcf.convert.ConverterImpl.traverse(ConverterImpl.java:88)
      ... 38 more
      2007-10-02 11:44:26,634 ERROR [com.tonbeller.wcf.controller.RequestFilter] cause
      java.lang.NullPointerException
      at com.tonbeller.jpivot.mondrian.MondrianQueryAdapter.<init>(MondrianQueryAdapter.java:64)
      at com.tonbeller.jpivot.mondrian.MondrianModel.setUserMdx(MondrianModel.java:835)
      at com.tonbeller.jpivot.mondrian.MondrianMdxQuery.setMdxQuery(MondrianMdxQuery.java:45)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:585)
      at org.apache.commons.beanutils.PropertyUtilsBean.invokeMethod(PropertyUtilsBean.java:1773)
      at org.apache.commons.beanutils.PropertyUtilsBean.setSimpleProperty(PropertyUtilsBean.java:1759)
      at org.apache.commons.beanutils.PropertyUtilsBean.setNestedProperty(PropertyUtilsBean.java:1648)
      at org.apache.commons.beanutils.PropertyUtilsBean.setProperty(PropertyUtilsBean.java:1677)
      at org.apache.commons.beanutils.PropertyUtils.setProperty(PropertyUtils.java:559)
      at com.tonbeller.wcf.convert.EditCtrlConverter.convert(EditCtrlConverter.java:72)
      at com.tonbeller.wcf.convert.ConverterImpl.traverse(ConverterImpl.java:88)
      at com.tonbeller.wcf.convert.ConverterImpl.traverse(ConverterImpl.java:111)
      at com.tonbeller.wcf.convert.ConverterImpl.traverse(ConverterImpl.java:111)
      at com.tonbeller.wcf.convert.ConverterImpl.traverse(ConverterImpl.java:111)
      at com.tonbeller.wcf.convert.ConverterImpl.traverse(ConverterImpl.java:111)
      at com.tonbeller.wcf.convert.ConverterImpl.traverse(ConverterImpl.java:111)
      at com.tonbeller.wcf.convert.ConverterImpl.validate(ConverterImpl.java:65)
      at com.tonbeller.wcf.form.FormComponent.validate(FormComponent.java:100)
      at com.tonbeller.wcf.form.ButtonHandler.request(ButtonHandler.java:94)
      at com.tonbeller.wcf.controller.DispatcherSupport.request(DispatcherSupport.java:167)
      at com.tonbeller.wcf.component.ComponentSupport.request(ComponentSupport.java:104)
      at com.tonbeller.wcf.controller.WcfController.request(WcfController.java:71)
      at com.tonbeller.wcf.controller.RequestFilter$MyHandler.normalRequest(RequestFilter.java:119)
      at com.tonbeller.wcf.controller.RequestSynchronizer.handleRequest(RequestSynchronizer.java:127)
      at com.tonbeller.wcf.controller.RequestFilter.doFilter(RequestFilter.java:263)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
      at org.pentaho.core.system.SystemStatusFilter.doFilter(SystemStatusFilter.java:53)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
      at org.pentaho.ui.servlet.SetCharacterEncodingFilter.doFilter(SetCharacterEncodingFilter.java:112)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
      at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
      at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:230)
      at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
      at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:179)
      at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:84)
      at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
      at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:104)
      at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:157)
      at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
      at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:241)
      at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
      at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:580)
      at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
      at java.lang.Thread.run(Thread.java:595)

      1. MondrianAxis.java
        4 kB
        Will Gorman
      2. MondrianQueryAdapter.java
        11 kB
        Will Gorman
      3. testingmdx.xaction
        2 kB
        Nick Goodman

        Activity

        Hide
        Will Gorman added a comment -

        minor change to this source file to fix the problem. line 64: if (monHiers[j] != null) {

        Show
        Will Gorman added a comment - minor change to this source file to fix the problem. line 64: if (monHiers [j] != null) {
        Hide
        Bill Seyler added a comment -

        See above comments. Nick, you should be able to test this by dropping the attached jar (and renaming it appropriately) in your current deployment.

        Show
        Bill Seyler added a comment - See above comments. Nick, you should be able to test this by dropping the attached jar (and renaming it appropriately) in your current deployment.
        Hide
        Bill Seyler added a comment -

        Ready for test with attached .jar

        Show
        Bill Seyler added a comment - Ready for test with attached .jar
        Hide
        Nick Goodman added a comment -

        Will test at the earliest possible point in time. Thanks guys!

        Show
        Nick Goodman added a comment - Will test at the earliest possible point in time. Thanks guys!
        Hide
        Nick Goodman added a comment -

        Confirmed this was resolved.

        The following MDX executes succesfully (CurrentDateMember and StrToMember both work)
        select

        {[Measures].[Sales]}

        ON COLUMNS,

        {CurrentDateMember([Time], '[Ti\me]\.[All Year\s]\.[\2\0\0\4]\.[\QTRq]'), StrToMember("[Time].[All Years].[2004].[QTR3]")}

        ON ROWS
        from [SteelWheelsSales]

        Measures
        Time Sales
        QTR4
        2,117,299
        QTR3
        1,145,308

        Thanks!

        Show
        Nick Goodman added a comment - Confirmed this was resolved. The following MDX executes succesfully (CurrentDateMember and StrToMember both work) select {[Measures].[Sales]} ON COLUMNS, {CurrentDateMember([Time], '[Ti\me]\.[All Year\s]\.[\2\0\0\4]\.[\QTRq]'), StrToMember("[Time].[All Years].[2004].[QTR3]")} ON ROWS from [SteelWheelsSales] Measures Time Sales QTR4 2,117,299 QTR3 1,145,308 Thanks!

          People

          • Assignee:
            Kurtis Cruzada
            Reporter:
            Nick Goodman
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: