Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

BI Java SDK ClassCastException

I am trying to run the BI Java SDK in a standalone environment and I am getting a ClassCastException when I try calling the getCubes() method.

Error:

Connection [com.sap.ip.bi.sdk.dac.connector.xmla.XmlaConnection] Supports Olap:

true

IBIOlap [com.sap.ip.bi.sdk.dac.connector.xmla.XmlaOlap] Supports BW: true

Feb 22, 2005 5:13:54 PM ...ector.xmla.impl.Connection.connectMdr [Thread[main,5

,main]] Path: Entering method

Feb 22, 2005 5:13:55 PM ....CommonConnection.OlapMDRConnection() [Thread[main,5

,main]] Path: Entering method

Feb 22, 2005 5:13:55 PM ...nector.impl.BIMDRConnection.connect() [Thread[main,5

,main]] Path: Entering method

Feb 22, 2005 5:13:55 PM ...ction.getMofPackageNamesResponsible() [Thread[main,5

,main]] Path: Entering method

Feb 22, 2005 5:13:55 PM ...dk.dac.connector.impl.BIMDRConnection [Thread[main,5

,main]] Path: Exiting method

Feb 22, 2005 5:13:55 PM ...etRepositoryServer(IRepositoryServer) [Thread[main,5

,main]] Path: Entering method

Feb 22, 2005 5:13:55 PM ...dk.dac.connector.impl.BIMDRConnection [Thread[main,5

,main]] Path: Exiting method

Feb 22, 2005 5:13:55 PM ...dk.dac.connector.impl.BIMDRConnection [Thread[main,5

,main]] Path: Exiting method

Feb 22, 2005 5:13:56 PM ...dk.dac.connector.xmla.impl.Connection [Thread[main,5

,main]] Path: Exiting method

java.lang.ClassCastException

at com.sap.ip.bi.sdk.dac.connector.olap.OlapMDRConnection.<init>(OlapMDR

Connection.java:259)

at com.sap.ip.bi.sdk.dac.connector.olap.CommonMDRConnection.<init>(Commo

nMDRConnection.java:87)

at com.sap.ip.bi.sdk.dac.connector.xmla.impl.XmlaMDRConnection.<init>(Xm

laMDRConnection.java:65)

at com.sap.ip.bi.sdk.dac.connector.xmla.impl.Connection.connectMdr(Conne

ction.java:251)

at com.sap.ip.bi.sdk.dac.connector.olap.CommonConnection.assertConnected

ToMDR(CommonConnection.java:120)

at com.sap.ip.bi.sdk.dac.connector.olap.CommonConnection.getTopLevelPack

age(CommonConnection.java:113)

at com.sap.ip.bi.sdk.dac.connector.xmla.XmlaOlap.getTopLevelPackage(Xmla

Olap.java:128)

at com.sap.ip.bi.sdk.dac.connector.impl.BIOlap.getQueryFactory(BIOlap.ja

va:43)

at com.sap.ip.bi.sdk.dac.connector.xmla.impl.Connection.getObjectFinder(

Connection.java:1233)

at com.sap.ip.bi.sdk.dac.connector.xmla.XmlaOlap.getObjectFinder(XmlaOla

p.java:167)

at Test.run(Test.java:123)

at Test.main(Test.java:247)

Code:

// Setting up the connectionDescriptor.

mcf = new XmlaManagedConnectionFactory();

cf = (IConnectionFactory) mcf.createConnectionFactory();

cs = cf.getConnectionSpec();

....

// DataSource

cs.setPropertyValue(XmlaConnectionConstants.DATA_SOURCE.toString(),"analysis");

// Statefulness

cs.setPropertyValue(XmlaConnectionConstants.STATEFULNESS.toString(),"false");

// Language

cs.setPropertyValue(XmlaConnectionConstants.LANGUAGE.toString(),"EN");

// Establishing the connection.

// The IBIOlap interface provides an entry point to access

// metadata and execute queries.

IBIConnection connection = (IBIConnection) cf.getConnectionEx(cs);

IBIOlap olap = connection.getOlap();

System.out.println("Connection ["connection.getClass().getName()"] Supports Olap: "+connection.supports(IBIConnection.Supports.OLAP));

System.out.println("IBIOlap ["olap.getClass().getName()"] Supports BW: "+olap.supports(IBIOlap.Supports.BW_CAPABILITIES));

List l = olap.getCube();

Former Member
Not what you were looking for? View more on this topic or Ask a question