on 10-19-2006 5:17 PM
Hi,
I closed a thread recenly and here is another one.
I have to fetch some data from MDM and bring it to my Web Dynpro application.
IConnectionSpec spec = connectionFactory.getConnectionSpec();
spec.setPropertyValue("UserName", "User");
spec.setPropertyValue("Password", "User");
spec.setPropertyValue("Server", "<IP ADDress>");
spec.setPropertyValue("Port", "XXXX");
spec.setPropertyValue("RepositoryLanguage", "English[US]");
try{
IConnection connection = connectionFactory.getConnectionEx(spec);
}
catch(ConnectionFailedException cfe){
}
catch(ConnectorException ce){
}
catch(Exception e){
throw new Exception(e.toString());
}
I am getting Null Pointer exception..
Does it mean that properties i am hardcoding are wrong?
Kindly let me know what could possibly be wrong here...
Hi,
This may be useful to you.
http://help.sap.com/saphelp_nw04s/helpdata/en/89/8a185c148e4f6582560a8d809210b4/content.htm
For more info go thru this link.
- Sridhar
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
In one of these threads, i came across a statement that "I checked from portal and connection tests to MDM server passed". How can i check this?
I have a similar scenario, and have already added MDM4j etc to the portal server, but do not know how to confirm the connectivity, this can be useful for me...
Any pointers?
Hi,
I guess on IConnectionSpec. Check with notnull, so that you can findout where exactly you have the error.
Regards,
Sridhar
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
hi,
You can make use the below code. It is running for me.
public static IConnection getConnection()throws Exception {
Context ctx = null;
String username = "";
String password = "";
String server = "";
String port = "";
String language = "";
try {
ctx = new InitialContext();
} catch (NamingException nex) {
throw new NamingException(nex.toString());
}
IConnectionFactory connectionFactory = null;
try {
connectionFactory =
(IConnectionFactory) ctx.lookup(
Messages.getString("MDM_FACTORY"));
} catch (NamingException nex) {
throw new NamingException(nex.toString());
}
IConnectionSpec spec = null;
try {
spec = connectionFactory.getConnectionSpec();
} catch (ConnectorException cex) {
throw new ConnectorException(cex.toString());
}
spec.setPropertyValue("UserName", username);
spec.setPropertyValue("Password", password);
spec.setPropertyValue("Server", server);
spec.setPropertyValue("Port", port);
IConnection connection = null;
try {
connection = connectionFactory.getConnectionEx(spec);
} catch (NullPointerException npex) {
throw new NullPointerException("Could not able to make connection to server :" + server + " port :" + port);
} catch (ConnectionFailedException cfex) {
throw new ConnectionFailedException(cfex.toString());
} catch (ConnectorException cex) {
throw new ConnectorException(cex.toString());
}
return connection;
}
Regards,
Sridhar
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
85 | |
10 | |
9 | |
9 | |
6 | |
6 | |
6 | |
5 | |
3 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.