Hitachi Vantara Pentaho Community Forums
Results 1 to 2 of 2

Thread: DynamicSchemaProcessor is failed in Pentaho CE 6.0.1.0-386

  1. #1

    Default DynamicSchemaProcessor is failed in Pentaho CE 6.0.1.0-386

    Hi,

    I have created one schema and tried to replace the keyword with DynamicSchemaProcessor. I have compiled DynamicSchemaProcessor successfully and placed in BI Server. When schemas are loading in BI Server UI, then following exception is coming in tomcat logs and my schema is not visible in schema list.

    ERROR :

    mondrian.olap.MondrianException: Mondrian Error:Internal error: loading DynamicSchemaProcessor OrgDynamicSchemaProcessor
    at mondrian.resource.MondrianResource$_Def0.ex(MondrianResource.java:982)
    at mondrian.olap.Util.newInternal(Util.java:2410)
    at mondrian.olap.Util.newError(Util.java:2426)
    at mondrian.rolap.RolapSchemaPool.processDynamicSchema(RolapSchemaPool.java:393)
    at mondrian.rolap.RolapSchemaPool.getSchemaContent(RolapSchemaPool.java:358)
    at mondrian.rolap.RolapSchemaPool.get(RolapSchemaPool.java:136)
    at mondrian.rolap.RolapSchemaPool.get(RolapSchemaPool.java:72)
    at mondrian.rolap.RolapConnection.<init>(RolapConnection.java:161)
    at mondrian.rolap.RolapConnection.<init>(RolapConnection.java:91)
    at mondrian.olap.DriverManager.getConnection(DriverManager.java:113)
    at mondrian.olap.DriverManager.getConnection(DriverManager.java:69)
    at mondrian.olap4j.MondrianOlap4jConnection.<init>(MondrianOlap4jConnection.java:162)
    at mondrian.olap4j.FactoryJdbc4Plus$AbstractConnection.<init>(FactoryJdbc4Plus.java:323)
    at mondrian.olap4j.FactoryJdbc41Impl$MondrianOlap4jConnectionJdbc41.<init>(FactoryJdbc41Impl.java:118)
    at mondrian.olap4j.FactoryJdbc41Impl.newConnection(FactoryJdbc41Impl.java:32)
    at mondrian.olap4j.MondrianOlap4jDriver.connect(MondrianOlap4jDriver.java:97)
    at java.sql.DriverManager.getConnection(DriverManager.java:571)
    at java.sql.DriverManager.getConnection(DriverManager.java:215)
    at org.saiku.datasources.connection.SaikuOlapConnection.connect(SaikuOlapConnection.java:111)
    at org.saiku.datasources.connection.SaikuOlapConnection.connect(SaikuOlapConnection.java:57)
    at org.saiku.datasources.connection.SaikuConnectionFactory.getConnection(SaikuConnectionFactory.java:29)
    at org.saiku.plugin.PentahoSecurityAwareConnectionManager.connect(PentahoSecurityAwareConnectionManager.java:201)
    at org.saiku.plugin.PentahoSecurityAwareConnectionManager.getInternalConnection(PentahoSecurityAwareConnectionManager.java:92)
    at org.saiku.datasources.connection.AbstractConnectionManager.getConnection(AbstractConnectionManager.java:131)
    at org.saiku.datasources.connection.AbstractConnectionManager.getAllConnections(AbstractConnectionManager.java:158)
    at org.saiku.datasources.connection.AbstractConnectionManager.getAllOlapConnections(AbstractConnectionManager.java:181)
    at org.saiku.olap.discover.OlapMetaExplorer.getAllConnections(OlapMetaExplorer.java:119)
    at org.saiku.service.olap.OlapDiscoverService.getAllConnections(OlapDiscoverService.java:58)
    at org.saiku.web.rest.resources.OlapDiscoverResource.getConnections(OlapDiscoverResource.java:60)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:606)
    at com.sun.jersey.spi.container.JavaMethodInvokerFactory$1.invoke(JavaMethodInvokerFactory.java:60)
    at com.sun.jersey.server.impl.model.method.dispatch.AbstractResourceMethodDispatchProvider$TypeOutInvoker._dispatch(AbstractResourceMethodDispatchProvider.java:185)
    at com.sun.jersey.server.impl.model.method.dispatch.ResourceJavaMethodDispatcher.dispatch(ResourceJavaMethodDispatcher.java:75)
    at com.sun.jersey.server.impl.uri.rules.HttpMethodRule.accept(HttpMethodRule.java:302)
    at com.sun.jersey.server.impl.uri.rules.ResourceClassRule.accept(ResourceClassRule.java:108)
    at com.sun.jersey.server.impl.uri.rules.RightHandPathRule.accept(RightHandPathRule.java:147)
    at com.sun.jersey.server.impl.uri.rules.RootResourceClassesRule.accept(RootResourceClassesRule.java:84)
    at com.sun.jersey.server.impl.application.WebApplicationImpl._handleRequest(WebApplicationImpl.java:1511)
    at com.sun.jersey.server.impl.application.WebApplicationImpl._handleRequest(WebApplicationImpl.java:1442)
    at com.sun.jersey.server.impl.application.WebApplicationImpl.handleRequest(WebApplicationImpl.java:1391)
    at com.sun.jersey.server.impl.application.WebApplicationImpl.handleRequest(WebApplicationImpl.java:1381)
    at com.sun.jersey.spi.container.servlet.WebComponent.service(WebComponent.java:416)
    at com.sun.jersey.spi.container.servlet.ServletContainer.service(ServletContainer.java:538)
    at com.sun.jersey.spi.container.servlet.ServletContainer.service(ServletContainer.java:716)
    at org.pentaho.platform.web.servlet.JAXRSPluginServlet.service(JAXRSPluginServlet.java:112)
    at org.saiku.plugin.resources.ExtendedJAXRSPluginServlet.service(ExtendedJAXRSPluginServlet.java:58)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:729)
    at org.pentaho.platform.web.servlet.JAXRSPluginServlet.service(JAXRSPluginServlet.java:117)
    at org.pentaho.platform.web.servlet.PluginDispatchServlet.service(PluginDispatchServlet.java:89)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:291)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
    at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:239)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
    at org.pentaho.platform.web.http.filters.PentahoWebContextFilter.doFilter(PentahoWebContextFilter.java:185)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:239)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
    at org.pentaho.platform.web.http.filters.PentahoRequestContextFilter.doFilter(PentahoRequestContextFilter.java:87)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:239)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
    at org.springframework.security.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:399)
    at org.springframework.security.intercept.web.FilterSecurityInterceptor.invoke(FilterSecurityInterceptor.java:109)
    at org.springframework.security.intercept.web.FilterSecurityInterceptor.doFilter(FilterSecurityInterceptor.java:83)
    at org.springframework.security.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:411)
    at org.springframework.security.ui.ExceptionTranslationFilter.doFilterHttp(ExceptionTranslationFilter.java:101)
    at org.springframework.security.ui.SpringSecurityFilter.doFilter(SpringSecurityFilter.java:53)
    at org.springframework.security.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:411)
    at org.springframework.security.providers.anonymous.AnonymousProcessingFilter.doFilterHttp(AnonymousProcessingFilter.java:105)
    at org.springframework.security.ui.SpringSecurityFilter.doFilter(SpringSecurityFilter.java:53)
    at org.springframework.security.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:411)
    at org.springframework.security.ui.basicauth.BasicProcessingFilter.doFilterHttp(BasicProcessingFilter.java:174)
    at org.pentaho.platform.web.http.security.PentahoBasicProcessingFilter.doFilterHttp(PentahoBasicProcessingFilter.java:115)
    at org.springframework.security.ui.SpringSecurityFilter.doFilter(SpringSecurityFilter.java:53)
    at org.springframework.security.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:411)
    at org.springframework.security.ui.AbstractProcessingFilter.doFilterHttp(AbstractProcessingFilter.java:278)
    at org.springframework.security.ui.SpringSecurityFilter.doFilter(SpringSecurityFilter.java:53)
    at org.springframework.security.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:411)
    at org.springframework.security.context.HttpSessionContextIntegrationFilter.doFilterHttp(HttpSessionContextIntegrationFilter.java:235)
    at org.springframework.security.ui.SpringSecurityFilter.doFilter(SpringSecurityFilter.java:53)
    at org.springframework.security.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:411)
    at org.pentaho.platform.web.http.filters.HttpSessionPentahoSessionIntegrationFilter.doFilter(HttpSessionPentahoSessionIntegrationFilter.java:263)
    at org.springframework.security.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:411)
    at org.springframework.security.wrapper.SecurityContextHolderAwareRequestFilter.doFilterHttp(SecurityContextHolderAwareRequestFilter.java:91)
    at org.springframework.security.ui.SpringSecurityFilter.doFilter(SpringSecurityFilter.java:53)
    at org.springframework.security.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:411)
    at org.springframework.security.util.FilterChainProxy.doFilter(FilterChainProxy.java:188)
    at org.springframework.security.util.FilterToBeanProxy.doFilter(FilterToBeanProxy.java:99)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:239)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
    at org.pentaho.platform.web.http.filters.SystemStatusFilter.doFilter(SystemStatusFilter.java:55)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:239)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
    at org.pentaho.platform.web.http.filters.SetCharacterEncodingFilter.doFilter(SetCharacterEncodingFilter.java:114)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:239)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
    at org.pentaho.platform.web.http.filters.WebappRootForwardingFilter.doFilter(WebappRootForwardingFilter.java:70)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:239)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
    at org.pentaho.platform.web.http.filters.PentahoPathDecodingFilter.doFilter(PentahoPathDecodingFilter.java:34)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:239)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:219)
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:106)
    at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:502)
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:142)
    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:79)
    at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:617)
    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:88)
    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:518)
    at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1091)
    at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:668)
    at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1527)
    at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.run(NioEndpoint.java:1484)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
    at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
    at java.lang.Thread.run(Thread.java:745)
    Caused by: java.lang.ClassCastException: OrgDynamicSchemaProcessor cannot be cast to mondrian.spi.DynamicSchemaProcessor
    at mondrian.rolap.RolapSchemaPool.processDynamicSchema(RolapSchemaPool.java:389)
    ... 116 more


    DynamicSchemaAnalyzer java file


    import java.io.InputStream;
    import java.sql.Connection;
    import java.sql.DriverManager;
    import java.sql.PreparedStatement;
    import java.sql.ResultSet;
    import java.util.regex.PatternSyntaxException;


    import mondrian.i18n.LocalizingDynamicSchemaProcessor;
    import mondrian.olap.Util;
    import mondrian.spi.DynamicSchemaProcessor;


    import org.pentaho.platform.api.engine.IPentahoSession;
    import org.pentaho.platform.engine.core.system.PentahoSessionHolder;


    public class OrgDynamicSchemaProcessor
    extends LocalizingDynamicSchemaProcessor
    implements DynamicSchemaProcessor {
    public String filter(final String schemaUrl, final Util.PropertyList connectInfo, final InputStream stream) throws Exception {

    System.out.println("------------------------------ SCHEMA URL BEGIN ------------------------------------------- ");
    System.out.println(schemaUrl);
    System.out.println("------------------------------ SCHEMA URL END ------------------------------------------- ");
    String schema = super.filter(schemaUrl, connectInfo, stream);
    System.out.println("------------------------------ SCHEMA BEGIN ------------------------------------------- ");
    System.out.println(schema);
    System.out.println("------------------------------ SCHEMA END ------------------------------------------- ");
    IPentahoSession session = PentahoSessionHolder.getSession();
    System.out.println(" SESSION = " + session );
    String region = session.getName();
    System.out.println(" REGION = " + region );
    Connection con = null;
    PreparedStatement pst = null;
    ResultSet rs = null;
    int organizationId = 0;
    Class.forName("com.mysql.jdbc.Driver");
    con = DriverManager.getConnection("jdbc:mysql://XX.XX.X.XX:3306/DB_NAME", "DB_USER", "DB_PASSWORD");
    String sql = "select organizationId from users_orgs where userId = (SELECT userid FROM user_ where screenName = ?)";
    pst = con.prepareStatement(sql);
    pst.setString(1, region);
    rs = pst.executeQuery();
    while (rs.next()) {
    System.out.print(" ORGANIZATION ID = " + rs.getInt("organizationId"));
    organizationId = rs.getInt("organizationId");
    }
    con.close();
    String orgId = String.valueOf(organizationId);
    System.out.println("printed region,getname is : " + orgId);
    try {
    schema = schema.replaceAll("%USER_REGION%", orgId);
    System.out.println("------------------------------ SCHEMA AFTER UPDATE ------------------------------------------- ");
    System.out.println(schema);

    }
    catch (PatternSyntaxException pse) {
    System.out.println("PatternSyntaxException in DynamicSchemaProcessor : " + orgId);
    pse.printStackTrace();
    }
    System.out.println("------------------------------ END ------------------------------------------- ");
    return schema;
    }
    }


    Following Jars added in Maven dependency to compile.

    <dependencies>
    <dependency>
    <groupId>pentaho</groupId>
    <artifactId>pentaho-platform-api</artifactId>
    <version>6.0.1.0-386</version>
    </dependency>
    <dependency>
    <groupId>pentaho</groupId>
    <artifactId>pentaho-platform-core</artifactId>
    <version>6.0.1.0-386</version>
    </dependency>
    <dependency>
    <groupId>pentaho</groupId>
    <artifactId>mondrian</artifactId>
    <version>3.11.1.0-386</version>
    </dependency>
    </dependencies>

    My Pentaho BI Server Version is : 6.0.1.0-386


    I have configured the DynamicSchema Processor
    Name:  Screenshot001.png
Views: 233
Size:  15.5 KB



    I am not sure why I am getting above exception, I didn't find the solution for it.

    Kindly advise to resolve this issue.


    Thanks
    Ravindar




  2. #2

    Default

    Hi Team,


    This issue has been resolved, I have followed the steps which are mentioned in following thread.

    http://forums.pentaho.com/showthread...7-in-Pentaho-6

    Steps followed :

    1. Deleted mondrian*.jar, eigenbase*.jar jars from Saiku lib folder .
    2.
    You also need to move the saiku-olap-util-3.7.3.jar
    from:
    saiku/lib/
    to:
    \tomcat\webapps\pentaho\WEB-INF\lib

    Restarted the BI Server then it started working.

    I didn't delete
    olap4j*.jar from Saiku lib directory because I didn't find those jars.

    Thanks

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Privacy Policy | Legal Notices | Safe Harbor Privacy Policy

Copyright © 2005 - 2019 Hitachi Vantara Corporation. All Rights Reserved.