olap4j Connection error while executing query

    olap4j Connection error while executing query



    I'm trying to use olap4j but when it comes to a query i get the following error

    Source Code

    1. Exception in thread "main" java.lang.RuntimeException: org.olap4j.OlapException: This connection encountered an exception while executing a query.
    2. at org.olap4j.driver.xmla.DeferredNamedListImpl.getList(DeferredNamedListImpl.java:94)
    3. at org.olap4j.driver.xmla.DeferredNamedListImpl.size(DeferredNamedListImpl.java:108)
    4. at org.olap4j.driver.xmla.XmlaOlap4jConnection.getOlapCatalog(XmlaOlap4jConnection.java:470)
    5. at org.olap4j.driver.xmla.XmlaOlap4jConnection.getCatalog(XmlaOlap4jConnection.java:463)
    6. at org.olap4j.driver.xmla.XmlaOlap4jStatement.executeOlapQuery(XmlaOlap4jStatement.java:286)
    7. at org.olap4j.sample.MyApplication.main(MyApplication.java:47)
    8. Caused by: org.olap4j.OlapException: This connection encountered an exception while executing a query.
    9. at org.olap4j.driver.xmla.XmlaHelper.createException(XmlaHelper.java:46)
    10. at org.olap4j.driver.xmla.XmlaOlap4jConnection.executeMetadataRequest(XmlaOlap4jConnection.java:812)
    11. at org.olap4j.driver.xmla.XmlaOlap4jConnection.populateList(XmlaOlap4jConnection.java:785)
    12. at org.olap4j.driver.xmla.DeferredNamedListImpl.populateList(DeferredNamedListImpl.java:120)
    13. at org.olap4j.driver.xmla.DeferredNamedListImpl.getList(DeferredNamedListImpl.java:88)
    14. ... 5 more
    15. Caused by: org.olap4j.driver.xmla.proxy.XmlaOlap4jProxyException: This proxy encountered an exception while processing the query.
    16. at org.olap4j.driver.xmla.proxy.XmlaOlap4jHttpProxy.getResponse(XmlaOlap4jHttpProxy.java:170)
    17. at org.olap4j.driver.xmla.proxy.XmlaOlap4jAbstractHttpProxy.get(XmlaOlap4jAbstractHttpProxy.java:184)
    18. at org.olap4j.driver.xmla.XmlaOlap4jConnection.executeMetadataRequest(XmlaOlap4jConnection.java:810)
    19. ... 8 more
    20. Caused by: java.io.IOException: Server returned HTTP response code: 401 for URL: http://localhost:4242
    21. at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1313)
    22. at org.olap4j.driver.xmla.proxy.XmlaOlap4jHttpProxy.getResponse(XmlaOlap4jHttpProxy.java:133)
    23. ... 10 more


    My code looks like this

    Source Code

    1. public static void main(String[] args) throws Exception {
    2. Class.forName("org.olap4j.driver.xmla.XmlaOlap4jDriver");
    3. Connection connection =
    4. DriverManager.getConnection(
    5. "jdbc:xmla:Server=http://localhost:4242;"
    6. + "User='admin';"
    7. + "Password='admin';");
    8. OlapWrapper wrapper = (OlapWrapper) connection;
    9. OlapConnection olapConnection = wrapper.unwrap(OlapConnection.class);
    10. OlapStatement statement = olapConnection.createStatement();
    11. CellSet cellSet =
    12. statement.executeOlapQuery(
    13. "SELECT {[Product].[All Products]} ON COLUMNS, {[Store].[All Stores]} ON ROWS FROM [Sales] WHERE ([Time].[1997])");
    14. TraditionalCellSetFormatter formatter =
    15. new TraditionalCellSetFormatter();
    16. formatter.format(cellSet, new PrintWriter(System.out));
    17. }


    I think it is a problem with the authentication but i can't find a solution for this problem.
    I hope somebody can help me with this problem.


    Kind regards MSchoess
    I'm using version 3.1

    and yes i already tried the MD5-hash password but i get the same error with it.

    Is there a possibility to test the MDX Interpreter or lookup the password?

    Because i can connect to the server e.g. when i try

    Source Code

    1. System.out.println(olapConnection.getDatabase());


    i get no error and this is the result

    Source Code

    1. Provider=PALO;DataSource=local;


    but when i try to request data it comes to the connection error.
    You have not provided either Catalog(Database) or Cube name for connecting,

    Modify your connection to include those:

    Connection connection = DriverManager.getConnection(
    "jdbc:xmla:server=http://localhost:4242;" + "User='admin';" + "Password='admin';" + "Catalog=YourDatabaseName;" + "Cube=Sales");



    Hope it helps!

    Best regards,
    Noel