US and Worldwide: +1 (866) 660-7555
Results 1 to 3 of 3

Thread: Dynamic Role Modification: can't compile

  1. #1
    Join Date
    Dec 2013
    Posts
    21

    Default Dynamic Role Modification: can't compile

    Hello Forum,

    I'm trying to follow advice from the Manning book "Mondrian in Action", in order to provide some access control to data in my cubes.
    After trying Dynamic Schema Processor (and not being able to solve problems with caching) I'm trying to use Dynamic Role Modification, but I can't compile the sample (downloaded the fixed version) of Listing 8.7 in the book.
    Here is the code I'm trying to compile (the only difference with the sample from the book is the name of the custom role):

    package mondrian.in.action;


    import mondrian.olap.*;
    import org.pentaho.platform.plugin.services.connections.mondrian.MDXConnection;


    public class CustomMDXConnection extends MDXConnection {


    @Override
    protected void init (Util.PropertyList properties) {
    super.init(properties);
    System.out.println("CustomMDXConnection: Setting the connection to restrict on Supervisor.");
    System.out.println("\tusing this instead of super");
    Connection thisConn = this.getConnection();
    if (thisConn != null) {
    Role authRole = thisConn.getSchema().lookupRole("Office Supervisor");


    if (authRole != null) {
    System.out.println("\tAssigning custom role.");
    CustomRoleDelegate customRole = new CustomRoleDelegate(authRole);


    thisConn.setRole(customRole);
    setRole(customRole);
    }
    }
    else {
    System.out.println("\tMDX connection is NULL!!");
    }
    }
    }



    I'm getting the error "The hierarchy of the type CustomMDXConnection is inconsistent".

    In my eclipse project, I'm referencing mondrian-3.5.0.jar, pentaho-bi-platform-plugin-services-4.8.0-stable.jar, pentaho-bi-platform-engine-core-4.8.0-stable.jar and pentaho-bi-platform-api-4.8.0-stable.jar and I'm working with jre7.

    Did anyone stumble into similar problems?
    What am I doing wrong?

    Stelvio.

  2. #2
    Join Date
    Dec 2013
    Posts
    21

    Default

    Tried to install and use jre6, but no changes.
    Tried to delete everything but the class declaration

    public class CustomMDXConnection extends MDXConnection {
    }

    and still have the same error.
    Any hints?

    Stelvio.

  3. #3
    Join Date
    Dec 2013
    Posts
    21

    Default

    Fixed!!

    I added pentaho-connections-2.2.3.jar to the build path.

    Stelvio.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •