Hi,
I´ve been trying to connect Optiq mongo to Saiku, and I'm having problems with the URL for the JDBC connection. I'm using Optiq 0.4.18-SNAPSHOT and I have connection to mongo from sqlline following the tutorial. Now I'm trying to configure a connection from Saiku adapting the instructions in
http://docs.analytical-labs.com/saiku/documentation/2013/08/15/datasources.html (I've been able to connect Saiku to Apache Phoenix this way). I think the problem is in the query string because I get the following messages from Saiku at catalina.out:
mondrian.olap.MondrianException: Mondrian Error:Internal error: Error while creating SQL connection: Jdbc=jdbc:optiq:model=file:/home/cloudera/Sistemas/optiq/mongodb/target/test-classes/mongo-zips-model-juanrh.json; JdbcUser=admin; JdbcPassword=admin
at mondrian.resource.MondrianResource$_Def0.ex(MondrianResource.java:972)
at mondrian.olap.Util.newInternal(Util.java:2421)
at mondrian.olap.Util.newError(Util.java:2437)
at mondrian.rolap.RolapConnection.<init>(RolapConnection.java:246)
at mondrian.rolap.RolapSchema.<init>(RolapSchema.java:187)
at mondrian.rolap.RolapSchema.<init>(RolapSchema.java:215)
at mondrian.rolap.RolapSchemaPool.get(RolapSchemaPool.java:214)
at mondrian.rolap.RolapSchemaPool.get(RolapSchemaPool.java:66)
at mondrian.rolap.RolapConnection.<init>(RolapConnection.java:160)
at mondrian.rolap.RolapConnection.<init>(RolapConnection.java:90)
at mondrian.olap.DriverManager.getConnection(DriverManager.java:112)
at mondrian.olap.DriverManager.getConnection(DriverManager.java:68)
at mondrian.olap4j.MondrianOlap4jConnection.<init>(MondrianOlap4jConnection.java:140)
at mondrian.olap4j.FactoryJdbc4Plus$AbstractConnection.<init>(FactoryJdbc4Plus.java:323)
at mondrian.olap4j.FactoryJdbc4Impl$MondrianOlap4jConnectionJdbc4.<init>(FactoryJdbc4Impl.java:104)
at mondrian.olap4j.FactoryJdbc4Impl.newConnection(FactoryJdbc4Impl.java:32)
at mondrian.olap4j.MondrianOlap4jDriver.connect(MondrianOlap4jDriver.java:132)
at java.sql.DriverManager.getConnection(DriverManager.java:582)
at java.sql.DriverManager.getConnection(DriverManager.java:185)
at org.saiku.datasources.connection.SaikuOlapConnection.connect(SaikuOlapConnection.java:75)
at org.saiku.datasources.connection.SaikuOlapConnection.connect(SaikuOlapConnection.java:46)
at org.saiku.datasources.connection.SaikuConnectionFactory.getConnection(SaikuConnectionFactory.java:29)
at org.saiku.web.impl.SecurityAwareConnectionManager.connect(SecurityAwareConnectionManager.java:265)
at org.saiku.web.impl.SecurityAwareConnectionManager.getInternalConnection(SecurityAwareConnectionManager.java:80)
at org.saiku.datasources.connection.AbstractConnectionManager.getConnection(AbstractConnectionManager.java:93)
at org.saiku.datasources.connection.AbstractConnectionManager.getAllConnections(AbstractConnectionManager.java:119)
at org.saiku.web.impl.SecurityAwareConnectionManager.init(SecurityAwareConnectionManager.java:57)
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:597)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeCustomInitMethod(AbstractAutowireCapableBeanFactory.java:1536)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1477)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1409)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:519)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:456)
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:291)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:288)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:190)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:574)
at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:895)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:425)
at org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:276)
at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:197)
at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:47)
at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:3972)
at org.apache.catalina.core.StandardContext.start(StandardContext.java:4467)
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:791)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:771)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:526)
at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:1041)
at org.apache.catalina.startup.HostConfig.deployDirectories(HostConfig.java:964)
at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:502)
at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1277)
at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:321)
at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1053)
at org.apache.catalina.core.StandardHost.start(StandardHost.java:722)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)
at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443)
at org.apache.catalina.core.StandardService.start(StandardService.java:516)
at org.apache.catalina.core.StandardServer.start(StandardServer.java:710)
at org.apache.catalina.startup.Catalina.start(Catalina.java:593)
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:597)
at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:289)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:414)
Caused by: java.sql.SQLException: No suitable driver found for jdbc:optiq:model=file:/home/cloudera/Sistemas/optiq/mongodb/target/test-classes/mongo-zips-model-juanrh.json
at java.sql.DriverManager.getConnection(DriverManager.java:602)
at java.sql.DriverManager.getConnection(DriverManager.java:154)
at org.apache.commons.dbcp.DriverManagerConnectionFactory.createConnection(DriverManagerConnectionFactory.java:68)
at org.apache.commons.dbcp.PoolableConnectionFactory.makeObject(PoolableConnectionFactory.java:294)
at org.apache.commons.pool.impl.GenericObjectPool.borrowObject(GenericObjectPool.java:974)
at org.apache.commons.dbcp.PoolingDataSource.getConnection(PoolingDataSource.java:96)
at mondrian.rolap.RolapConnection.<init>(RolapConnection.java:226)
... 66 more
On the other hand with sqlline I was able to connect with
sqlline> !connect jdbc:optiq:model=/home/cloudera/Sistemas/optiq/mongodb/target/test-classes/mongo-zips-model-juanrh.json admin admin
I've tried with variants on this and I get the same error:
Caused by: java.sql.SQLException: No suitable driver found for jdbc:optiq:model=/home/cloudera/Sistemas/optiq/mongodb/target/test-classes/mongo-zips-model-juanrh.json
Caused by: java.sql.SQLException: No suitable driver found for jdbc:optiq:model=///home/cloudera/Sistemas/optiq/mongodb/target/test-classes/mongo-zips-model-juanrh.json
Caused by: java.sql.SQLException: No suitable driver found for jdbc:optiq:model:file:///home/cloudera/Sistemas/optiq/mongodb/target/test-classes/mongo-zips-model-juanrh.json
My Saiku configuration is as follows, in case it helps:
type=OLAP
name=optiqmongo
driver=mondrian.olap4j.MondrianOlap4jDriver
# location=jdbc:mondrian:Jdbc=jdbc:phoenix:localhost;Catalog=res:phoenix/Phoenix.xml;JdbcDrivers=org.apache.phoenix.jdbc.PhoenixDriver
location=jdbc:mondrian:Jdbc=jdbc:optiq:model=/home/cloudera/Sistemas/optiq/mongodb/target/test-classes/mongo-zips-model-juanrh.json;Catalog=res:optiq-mongo/OptiqMongo.xml;JdbcDrivers=net.hydromatic.optiq.impl.mongodb.MongoSchemaFactory;
username=admin
password=admin
Any idea will be welcome. Thanks a lot for your help!
Greetings,
Juan Rodriguez