Skip to Content

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

Problems with JNDI lookup: NamingException

Scenario: I want to search an MDM repository on an MDM server using SAP MDM Connector.For that,I deployed the two SDA’s viz. com.sap.mdm.tech.connector.sda and com.sap.mdm.tech.mdm4j.sda onto the SAP J2EE engine.For testing purpose , I am using a standalone Java class to do a JNDI lookup for the deployed MDM connector.But the lookup is throwing a NamingException.I have added all the JAR files like sapj2eeclient.jar , jndi.jar , Connector.jar , ExtendedConnector.jar etc to the classpath of my application.But still it throws the NamingException.

My code is as follows:

public static void main(String[] args)

{

Context ct =null;

Hashtable env = new Hashtable();

env.put(Context.INITIAL_CONTEXT_FACTORY,

"com.sap.engine.services.jndi.InitialContextFactoryImpl");

env.put(Context.PROVIDER_URL,"<hostname>:50004");

try {

ct = new InitialContext(env);

} catch(NamingException e)

{

System.out.println("err");

e.printStackTrace();

}

try

{

IConnectionFactory cf =(IConnectionFactory) ct.lookup("deployedAdapters/MDM Factory/shareable/MDM Factory");

IConnectionSpec spec = cf.getConnectionSpec();

/* the code to search catalog follows*/

}catch(Exception e)

{

e.printStacktrace();

}

The exception thrown is:

com.sap.engine.services.jndi.persistent.exceptions.NamingException: Exception during lookup operation of object with name deployedAdapters/MDM Factory/shareable/MDM Factory, cannot resolve object reference. [Root exception is com.sap.engine.services.connector.exceptions.BaseResourceException: Cannot lookup ManageConnectionFactory "MDM Factory". Cannot deserialize object: java.lang.ClassNotFoundException: com.sap.mdm.connector.connection.MdmManagedConnectionFactory

I'll be thankful for any help/suggestions on this.

Former Member

Helpful Answer

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