cancel
Showing results for 
Search instead for 
Did you mean: 

MDM Data Fetch - Java API

Former Member
0 Kudos

Hi,

I am using the following code to fetch data from a table in MDM.


Context ctx = new InitialContext();

		IConnectionFactory connectionFactory = (IConnectionFactory)ctx.lookup("deployedAdapters/MDM Factory/shareable/MDM Factory");

		IConnectionSpec spec = connectionFactory.getConnectionSpec();

		spec.setPropertyValue("UserName", "");
		spec.setPropertyValue("Password", "");
		spec.setPropertyValue("Server", "");
		spec.setPropertyValue("Port", "");
		spec.setPropertyValue("RepositoryLanguage", "");

		IConnection connection = connectionFactory.getConnectionEx(spec);


		INative nativeInterface = connection.retrieveNative();

		CatalogData catalog = (CatalogData) nativeInterface.getNative(CatalogData.class.getName());


		ResultSetDefinition resultdefenition = new ResultSetDefinition("Products");
		resultdefenition.AddField("Id");

		Search search = new Search("Products");

		A2iResultSet rs = catalog.GetResultSet(search, resultdefenition, "Id", true, 0);


		connection.close();

I am getting the following exception at design time:

The project was not built since its classpath is incomplete. Cannot find the class file for javax.resource.cci.ConnectionSpec. Fix the classpath then try rebuilding this project.

This compilation unit indirectly references the missing type javax.resource.cci.ConnectionSpec (typically some required class file is referencing a type outside the classpath)

This issue has been bothering me for days now and it doesn't seem to go!

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Devashish,

You need to include Connector.jar file in your classpath. This file contains the connectionSpec.class file which is being referenced by your program.

Regards,

Mausam

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi Dev,

if you deploy your par file in Portal (your application Java code runs on Portal framework), then please use the Java code sample/suggestion mentioned in .

If it still does not work, then probably would be good to work together using MS Net Meeting...

Laszlo.

Former Member
0 Kudos

Hi Dev,

it seems in this message you got the same suggestion as already mentioned in an other from you.

Did you already try it and it did not work ?

Regards.

Laszlo.

Former Member
0 Kudos

Hi Guyz,

Thanks to you, that error is gone

Could you let me know whicj JAR Files contain CatalogData, ResultSetDefinition, Search, A2IResultSet etc...

Former Member
0 Kudos

Hi,

I got to know from forums and docs that a2i* is the package which i need to import.

Could anyone pass me the path from where i can download?

Regards,

Dev.

Former Member
0 Kudos

hi Devashish,

Thise classes are there in MDM4J.jar file. You can dowanload JAVA APIs from Service Market Place.

Regards,

Mausam

Former Member
0 Kudos

Hi Mausam,

Thanks for immediate reply.

The issue is now resolved and i am not getting any compile time errors now.

I am new so would be asking few more questions to get my application working.

I am getting a NoClassDefFound error where i am trying to lookup.

Where exactly do we need to go in Visual Administrator to fetch the "correct" JNDI Path?

Also, MDM (same version) needs to be installed with the WAS to make this application run successfully or how do we establish between MDM Server and my WAS on 2 separate systems.

Regards,

Dev.

Former Member
0 Kudos

Anybody guys, i am new to this MDM so am unable to solve these issues... any help/pointers appreciated...

Former Member
0 Kudos

Hi Dev,

Did you deploy the MDM Connector on the WAS using SDM?

Richard

Former Member
0 Kudos

Hi Dev,

check if the sca files were deployed as suggested in .

Regards.

Laszlo.

Former Member
0 Kudos

yes,

i have deployed all the JAR files.

I think there is some issue with JNDI lookup..

The error is:

Path to object does not exist at MDM Factory.

The path which i am giving is:

deployedAdapters/MDM Factory/shareable/MDM Factory

I checked in Visual Admin, and the path is right.

Any pointers what could be wrong?

Former Member
0 Kudos

Hi Guys,

I am stuck in this thing for almost 2 days now..

I am getting NoClassDefFoundError at run time for IConnectionFactory!

I am sure its related to path, classpath etc, but what exactly have no clue... anyone?

Former Member
0 Kudos

Hi Devashish,

Have you given run time reference to the J2EE ConnectorFramework.... like sap.com/tcconnconnectorframework? That could be the problem here. Please check it.

Check <a href="https://www.sdn.sap.comhttp://www.sdn.sap.comhttp://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/2d18d355-0601-0010-fdbb-d8b143420f49">this</a> PDF on page 11.

Regards,

Mausam

Message was edited by: Mausam Kakkad

Former Member
0 Kudos

Hey Mausam,

That did the trick for me...

I was trying to somehow forcibly set reference of this jar in server, then your link came!

Am not getting thsi error anymore, have next issue already, but will open a new thread...

Thanks guys..