sql server 2008 - Mondrian Olap ClassNotFoundException: mondrian.olap4j.MondrianOlap4jDriver -
i have build schema file of mondrian , sql server.
now writing code in java database connection using olap4j.
code :
try { class.forname("mondrian.olap4j.mondrianolap4jdriver"); string connectionstring1 = "type=olap name=sales driver=mondrian.olap4j.mondrianolap4jdriver location=jdbc:mondrian:jdbc=jdbc:sqlserver://servername:1433;database=tempdatabase;catalog=c:/schema1.xml;jdbcdrivers=com.microsoft.sqlserver.jdbc.sqlserverdriver username=sa password=p@ssw0rd"; connection jdbcconnection = drivermanager.getconnection(connectionstring1); olapconnection connection = ((olapwrapper)jdbcconnection).unwrap(olapconnection.class); olapstatement olapstatement = connection.createstatement(); } catch (sqlexception e) { e.printstacktrace(); }catch (classnotfoundexception e) { e.printstacktrace(); }
but giving me error while running code :
java.lang.classnotfoundexception: mondrian.olap4j.mondrianolap4jdriver @ java.net.urlclassloader$1.run(unknown source) @ java.security.accesscontroller.doprivileged(native method) @ java.net.urlclassloader.findclass(unknown source) @ java.lang.classloader.loadclass(unknown source) @ sun.misc.launcher$appclassloader.loadclass(unknown source) @ java.lang.classloader.loadclass(unknown source) @ java.lang.class.forname0(native method) @ java.lang.class.forname(unknown source) @ com.tuto.test.main(test.java:16)
i using following jars :
1.asm.jar 2.asm-commons.jar 3.asm-tree.jar 4.javacup.jar 5.olap4j-1.0.0.445.jar 6.olap4j-xmla-1.0.0.445.jar 7.retroweaver.jar 8.retroweaver-rt.jar 9.sqljdbc.jar 10.xercesimpl.jar 11.olap4j-tck-1.0.0.445.jar
please me why getting error?
thanks.
you trying use mondrian implementation of olap4j, mondrian isn't in class path. have download mondrian , dependencies.
also, can remove following libraries.
- retroweaver*.jar
- olap4j-tck
- olap4j-xmla
the retroweaver runtime necessary if use jdk4 version of olap4j. olap4j-tck useful if implementing olap4j driver , wanted test it.
also note connection url pretty messed up. i'm pretty sure won't work. should check basic code examples provided here started.
Comments
Post a Comment