Skip to Content

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

Problem in Getting connection using MDM JAVA API..?

Hi Experts,

I am new to MDM.Recently I was shifted from java to MDM.I got the below problem when i run my application for getting connection.I got coneection but display some error message.Please see my code and problem.

problem

-


Exception in thread "main" java.lang.NullPointerException com.sap.mdm.server.commands.GetServerVersionCommand.getVersion

code

-


import com.sap.mdm.commands.*;

import com.sap.mdm.net.ConnectionException;

import com.sap.mdm.net.SimpleConnection;

import com.sap.mdm.net.SimpleConnectionFactory;

import com.sap.mdm.server.commands.GetServerVersionCommand;

public class Application2 {

public static void main(String[] args){

System.out.println("-Connection not yet created--");

String connectionTag = "MDMServer";

SimpleConnection connection = null;

try {

connection = SimpleConnectionFactory.getInstance(connectionTag);

System.out.println("-Connection created--");

System.out.println("---Host Name -


" + connection.getHostname());

System.out.println("---Port No -


" + connection.getPort());

System.out.println("---Identity -


" + connection.getIdentity());

System.out.println( "---ConnectionSource -


" + connection.getConnectionSource());

System.out.println( "-Connection is ready--" + connection.isReady());

} catch (ConnectionException e) {

e.printStackTrace();

System.out.println("Version problem:"+e);

return;

}

GetServerVersionCommand cmd = new GetServerVersionCommand(connection);

System.out.println("MDM server Class: " + cmd.getClass());

System.out.println("MDM server Class: " + cmd.getSession());

System.out.println("MDM server Class: " + cmd.getVersion());

}

}

can anybody helm me out in these issues

Regards

Satish

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