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 SDAs 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();
ct = new InitialContext(env);
} catch(NamingException e)
IConnectionFactory cf =(IConnectionFactory) ct.lookup("deployedAdapters/MDM Factory/shareable/MDM Factory");
IConnectionSpec spec = cf.getConnectionSpec();
/* the code to search catalog follows*/
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.