cancel
Showing results for 
Search instead for 
Did you mean: 

BI Java SDK ClassCastException

Former Member
0 Kudos

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();

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

dear steve,

just mail to this id srinis_sap@yahoo.com. i could send u the bi java program for getCubes(), i tried and got successed for the task in listing all cubes from our bw server 3.5 with NW'04 component and WAS 6.40. hope the program might help you. have fun!

rgds,

srinu...