connect to SSAS using olap4j on Linux machine (Ubuntu14.04)

  • anjali

    anjali - 2014-08-28

    I wish to connect to SSAS 2012 using Java and have tried olap4j driver for the same.
    I am working on Linux (Ubuntu 14.04) platform.

    I have read that Olap4j works for Windows but will it work on Linux ?

    I have written a java code which gives run time error. This error is because Linux pc is unable to connect to SSAS.
    May you please help me finding the reason of not being able to connect ?

    I have set http access and IIS server and using msmdpump.dll to connect.

    Below is the java code and the error.


    package ssas;
    import java.sql.Connection;
    //import java.lang.*;
    import java.sql.DriverManager;
    import java.sql.SQLException;

    import org.olap4j.Cell;
    import org.olap4j.CellSet;
    import org.olap4j.OlapConnection;
    import org.olap4j.OlapException;
    import org.olap4j.OlapStatement;
    import org.olap4j.OlapWrapper;
    import org.olap4j.Position;
    import org.olap4j.metadata.Member;

    public class connexionSSAS
    public static void main(String[] args) throws ClassNotFoundException, OlapException {

    Connection connection = null;
    connection = DriverManager.getConnection("jdbc:xmla:Server=http://01XXXXXXXX/olap/msmdpump.dll;"
                                                        + "Catalog=sample_Cube");
    }catch (SQLException e)
    if (null== connection){
    OlapWrapper wrapper = (OlapWrapper) connection;
    OlapConnection olapConnection = null;
    try {
    olapConnection = wrapper.unwrap(OlapConnection.class);
    } catch (SQLException e) {
    OlapStatement statement = null;
    CellSet cellSet = null;
    try {
    statement = (OlapStatement) olapConnection.createStatement();
    catch(SQLException e)



    Exception in thread "main" java.lang.RuntimeException: org.olap4j.OlapException: This connection encountered an exception while executing a query.
    at org.olap4j.driver.xmla.DeferredNamedListImpl.getList(
    at org.olap4j.driver.xmla.DeferredNamedListImpl.size(
    at org.olap4j.driver.xmla.XmlaOlap4jConnection.getOlapDatabase(
    at org.olap4j.driver.xmla.XmlaOlap4jConnection.getOlapCatalogs(
    at org.olap4j.driver.xmla.XmlaOlap4jConnection.setCatalog(
    at ssas.connexionSSAS.main(
    Caused by: org.olap4j.OlapException: This connection encountered an exception while executing a query.
    at org.olap4j.driver.xmla.XmlaHelper.createException(
    at org.olap4j.driver.xmla.XmlaOlap4jConnection.executeMetadataRequest(
    at org.olap4j.driver.xmla.XmlaOlap4jDatabaseMetaData.getMetadata(
    at org.olap4j.driver.xmla.XmlaOlap4jDatabaseMetaData.getMetadata(
    at org.olap4j.driver.xmla.XmlaOlap4jDatabaseMetaData.getDatabaseProperties(
    at org.olap4j.driver.xmla.XmlaOlap4jConnection.makeConnectionPropertyList(
    at org.olap4j.driver.xmla.XmlaOlap4jConnection.generateRequest(
    at org.olap4j.driver.xmla.XmlaOlap4jConnection.populateList(
    at org.olap4j.driver.xmla.DeferredNamedListImpl.populateList(
    at org.olap4j.driver.xmla.DeferredNamedListImpl.getList(
    ... 5 more

    This code will run if I comment the statements containing 'OlapConnection'.
    Any help would be appreciated.

    • Julian Hyde

      Julian Hyde - 2014-08-28

      The exception seems to occur when you call setCatalog. Is “sample_Cube” a valid catalog name?


      • anjali

        anjali - 2014-09-01

        Yes Julian. The cube name is valid which is present in the analysis server. I have access to that cube as well.
        Is this problem occurring because I am using Linux ?

    • Julian Hyde

      Julian Hyde - 2014-09-02

      I doubt that it's because you're on Linux. The code behaves pretty much the same on all operating systems.

      I'll repeat my question.

      Is "sample_Cube" a valid catalog name? (Catalog names are case-sensitive. Catalog names are not cube names.)


Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

No, thanks