[Mondrian] Partial rollup policy not working? Testcase included

Pedro Alves pedro at neraka.no-ip.org
Sat Jul 12 23:09:48 EDT 2008



I had some problems compiling mondrian from sources. It complained from
missing OlapException. I fetched olap4j from svn root and used it to
compile 3.0.3.11016... in the end I got a jar that seemed to work. 


All this to say that the following patch worked (just a test for a null value):

Index: src/main/mondrian/rolap/RolapHierarchy.java
===================================================================
--- src/main/mondrian/rolap/RolapHierarchy.java (revision 1906)
+++ src/main/mondrian/rolap/RolapHierarchy.java (working copy)
@@ -933,8 +933,8 @@
         }
 
         public RolapMember substitute(final RolapMember member) {
-            if (hierarchyAccess.getAccess(member) == Access.CUSTOM
-                || hierarchyAccess.hasInaccessibleDescendants(member)) 
+            if (member != null && (hierarchyAccess.getAccess(member) == Access.CUSTOM
+                || hierarchyAccess.hasInaccessibleDescendants(member))) 
             {
                 // Member is visible, but at least one of its
                 // descendants is not.




On Sun, Jul 13, 2008 at 02:30:21AM +0100, Pedro Alves wrote:
> 
> 
> 
> 
> Hello everyone.
> 
> 
> With latest mondrian (3.0.3.11016) I can't make rollupPolicy rule work - at
> least not as I expected. Mondrian calculates the result fine but jpivot
> does not render the results.
> 
> 
> Test:
> 
> Add this rule to the steel-wheels example (I don't want a topLevel, but I've tried with it and  still can't make it work):
> 
> <Role name="default">
>       <SchemaGrant access="none">
>           <CubeGrant cube="SteelWheelsSales" access="all">
>              <HierarchyGrant hierarchy="[Markets]" access="custom" rollupPolicy="partial" >
>                     <MemberGrant member="[Markets].[All Markets]" access="all"/>
>                     <MemberGrant member="[Markets].[All Markets].[NA].[Canada]" access="all"/>
>                 </HierarchyGrant>
>           </CubeGrant>
>       </SchemaGrant>
>   </Role>
> 
> 
> And then try in jpivot this mdx:
> 
>             select NON EMPTY {[Measures].[Quantity]} ON COLUMNS,
>   NON EMPTY [Markets].[All Markets] ON ROWS
> from [SteelWheelsSales]
> 
> 
> Here's the stacktrace:
> 
> 2008-07-13 02:27:04,475 ERROR [com.tonbeller.wcf.component.RendererTag] trouble rendering table01
> java.lang.NullPointerException
>         at mondrian.olap.RoleImpl$HierarchyAccessImpl.getAccess(RoleImpl.java:490)
>         at mondrian.rolap.RolapHierarchy$LimitedRollupSubstitutingMemberReader.substitute(RolapHierarchy.java:936)
>         at mondrian.rolap.SubstitutingMemberReader.getMemberParent(SubstitutingMemberReader.java:183)
>         at mondrian.rolap.RolapSchemaReader.getMemberParent(RolapSchemaReader.java:111)
>         at mondrian.olap.DelegatingSchemaReader.getMemberParent(DelegatingSchemaReader.java:52)
>         at com.tonbeller.jpivot.mondrian.MondrianMember.getRootDistance(MondrianMember.java:90)
>         at com.tonbeller.jpivot.table.span.SpanCalc.calcIndent(SpanCalc.java:418)
>         at com.tonbeller.jpivot.table.span.SpanCalc.initialize(SpanCalc.java:92)
>         at com.tonbeller.jpivot.table.span.SpanCalc.createPositionHeader(SpanCalc.java:245)
>         at com.tonbeller.jpivot.table.RowAxisBuilderImpl.initialize(RowAxisBuilderImpl.java:130)
>         at com.tonbeller.jpivot.table.AxisBuilderSupport.startBuild(AxisBuilderSupport.java:229)
>         at com.tonbeller.jpivot.table.TableComponent.startBuild(TableComponent.java:192)
>         at com.tonbeller.jpivot.table.TableComponent.render2(TableComponent.java:259)
>         at com.tonbeller.jpivot.table.TableComponent.render(TableComponent.java:235)
>         at com.tonbeller.wcf.component.RendererTag.doEndTag(RendererTag.java:137)
>         at org.apache.jsp.jsp.Pivot_jsp._jspx_meth_wcf_005frender_005f8(Pivot_jsp.java:3068)
>         at org.apache.jsp.jsp.Pivot_jsp._jspService(Pivot_jsp.java:1738)
>         at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:98)
>         at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
>         at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:331)
>         at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:329)
>         at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:265)
>         at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
>         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:269)
>         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
>         at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:265)
>         at org.acegisecurity.intercept.web.FilterSecurityInterceptor.invoke(FilterSecurityInterceptor.java:107)
>         at org.acegisecurity.intercept.web.FilterSecurityInterceptor.doFilter(FilterSecurityInterceptor.java:72)
>         at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:275)
>         at org.acegisecurity.ui.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:124)
>         at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:275)
>         at org.acegisecurity.ui.switchuser.SwitchUserProcessingFilter.doFilter(SwitchUserProcessingFilter.java:341)
>         at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:275)
>         at com.pentaho.security.SecurityStartupFilter.doFilter(SecurityStartupFilter.java:76)
>         at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:275)
>         at org.acegisecurity.providers.anonymous.AnonymousProcessingFilter.doFilter(AnonymousProcessingFilter.java:125)
>         at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:275)
>         at org.acegisecurity.ui.rememberme.RememberMeProcessingFilter.doFilter(RememberMeProcessingFilter.java:142)
>         at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:275)
>         at com.pentaho.security.RequestParameterAuthenticationFilter.doFilter(RequestParameterAuthenticationFilter.java:164)
>         at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:275)
>         at org.acegisecurity.ui.basicauth.BasicProcessingFilter.doFilter(BasicProcessingFilter.java:174)
>         at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:275)
>         at org.acegisecurity.ui.AbstractProcessingFilter.doFilter(AbstractProcessingFilter.java:271)
>         at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:275)
>         at org.acegisecurity.ui.logout.LogoutFilter.doFilter(LogoutFilter.java:110)
>         at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:275)
>         at com.pentaho.security.HttpSessionReuseDetectionFilter.doFilter(HttpSessionReuseDetectionFilter.java:130)
>         at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:275)
>         at org.acegisecurity.context.HttpSessionContextIntegrationFilter.doFilter(HttpSessionContextIntegrationFilter.java:249)
>         at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:275)
>         at org.acegisecurity.wrapper.SecurityContextHolderAwareRequestFilter.doFilter(SecurityContextHolderAwareRequestFilter.java:81)
> 
> 
> 
> -- 
> Pedro Alves
> 
> _______________________________________________
> Mondrian mailing list
> Mondrian at pentaho.org
> http://lists.pentaho.org/mailman/listinfo/mondrian

-- 
Pedro Alves
pmgalves-at-gmail.com




More information about the Mondrian mailing list