cancel
Showing results for 
Search instead for 
Did you mean: 

Connection hangs!

Former Member
0 Kudos

Hi,

I am not sure what this means...

Whatever code i had written for so many days is not working as the way it worked. Explorer simply hangs and status bar keeps moving, but no output and no exceptions.

So, I tried using a simple connection program via MDM4J but that also failed.

My Explorer window does not crash but does not give me output either.

It keeps on running and running. I left it running for more than 30 mins and still no output came.

I went to MDM Console to find whether any connectiond have opened, but nope 0 connections.

I tried the foll basic code:


import javax.naming.Context;
import javax.naming.InitialContext;
import javax.naming.NamingException;
import com.sapportals.connector.ConnectorException;
import com.sapportals.connector.connection.ConnectionFailedException;
import com.sapportals.connector.connection.IConnection;
import com.sapportals.connector.connection.IConnectionFactory;
import com.sapportals.connector.connection.IConnectionSpec;

public class ConnectionManager {
public static IConnection getConnection() throws Exception {
Context ctx = null;
try {
ctx = new InitialContext();
} catch (NamingException nex) {
throw new NamingException(nex.toString());
} 
IConnectionFactory connectionFactory = null;
try {
connectionFactory =
(IConnectionFactory) ctx.lookup(
"deployedAdapters/MDM Factory/shareable/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", "mdmadmin");
spec.setPropertyValue("Password", "mdmadmin");
spec.setPropertyValue("Server", "10.133.22.4");
spec.setPropertyValue("Port", "2025");
spec.setPropertyValue("RepositoryLanguage", "English [US]");
IConnection connection = null;
try {
connection = connectionFactory.getConnectionEx(spec);
} catch (NullPointerException npex) {
throw new NullPointerException("Could not able to make a connections.");
} catch (ConnectionFailedException cfex) {
throw new ConnectionFailedException(cfex.toString());
} catch (ConnectorException cex) {
throw new ConnectorException(cex.toString());
}
return connection;
}

public static void closeConnection(IConnection connection)
throws Exception {
connection.close();
}
}

Next when i tried this, i did get the desired output:


static private CatalogData catalog = null;

static private String hostname = "BOGN00408258A";
static private int port = 2345;
static private String username = "Admin";
static private String password = "";
static private String language = "English [US]";

public static void main(String[] args) {
//
// login
//

// create catalogdata object
catalog = new CatalogData();

// try logging in
// NOTE: CatalogData.Login() will also throw a java.net.ConnectException
int resultLogin = catalog.Login(hostname, port, username, password, language);
if (resultLogin != RC.RC_OK) {
System.out.println(
"Error logging into MDME server: " + RC.GetTextForError(resultLogin) + " (" + resultLogin + ")");
System.exit(-1);
}
System.out.println("Logged into MDME server.n");

//
// status
//

// get information on the current catalog connection
System.out.println("Status of server:n");
System.out.print("t Status of catalog connection: ");
int resultReadyStatus = catalog.GetReadyStatus();
switch (resultReadyStatus) {
case CatalogData.READY_STATE_CONNECTED :
System.out.println("connected");
break;
case CatalogData.READY_STATE_CONNECTING :
System.out.println("connecting");
break;
case CatalogData.READY_STATE_DISCONNECTED :
System.out.println("disconnected");
break;
default :
System.out.println("unknown status " + resultReadyStatus);
break;
}
// display some catalog information
System.out.println("t Connections: " + catalog.GetConnectionCount());
System.out.println("t Server: " + catalog.GetServer());
System.out.println("t Port: " + catalog.GetPort());
System.out.println("t User: " + catalog.GetUser());
System.out.println("t Software version: " + catalog.GetSoftwareVersion());
System.out.println();

// status call to catalog
int resultStatus = catalog.CatalogStatus(hostname, port, username, password);
System.out.println("Status of catalog: " + RC.GetTextForError(resultStatus) + " (" + resultStatus + ")n");

//
// logout
//

// catch possible exception
try {
catalog.Logout();
System.out.println("Logged out of MDM server.");
} catch (StringException e) {
System.out.println("Error logging out of MDM server: " + e.getMessage());
} finally {
// exit the console application

}

}

I am not too sure what is happ... if any1 of you has faced a similar issue, please let me know.

Also, i went to Portal and tried to create a new system for this MDM server.. when i gave IP Address and Password and clicked Next again, explorer keeps on moving, but gives no output! Not sure what this means guys... but other teams like XI etc can connect to the same box...

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

I was running into a similar issue with the ABAP API. Where is the Java connection coming from? Are you running MDM on UNIX or Windows?

I know this is slightly different, but I can describe the situation I am running into and possibly it will spark something that may set you in the right direction. For some reason the ABAP API was holding onto a port which was blocking certain peices of MDM. For example, I would attempt to start up the syndication server and I would recieve a connection error. After doing some research on the server by running netstat I found that ECC had opened a connection and wasn't letting go. So I would have to go into ECC SM51 and "cancel without core" the process that wasn't hanging onto that port. Then the service would start up.

Like I said, not the solution for you, but maybe there is a similar issue with the Java API? What do your log files say?

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi Devashish,

I'm facing the same problem and my connection hangs with out any output. Could you please tell me how did you resolve the problem? Which API u used or if possible could u send me sample connection code?

I'm using SP4 and code works perfectly in SP3.

Thanks for your time and help in advance.

Best Regards,

Shiva

Former Member
0 Kudos

Try stopping and then restarting the MDM Server.

Former Member
0 Kudos

Harrison, Thanks for your inputs.

Dev MDM Server runs on Windows (32-bit) and am trying to hit that via MDM4J

Walter, Restarting MDM Server did not help.

I also undeployed and then re-deployed all MDM Components from my portal server. Restarted the server but to no avail.... Same issue Explorer does nothing and status bar keeps moving.

Any ideas guys what can be the potential cause?

Regards,

Dev.

Former Member
0 Kudos

This may seem like a dumb question, as I am sure you have already looked into all this, but were there any changes made to the MDM server or the subnet it's on between now and when it was last working? If we can narrow it down to even something that may seem trivial, possibly it would give us an avenue to explore.

Former Member
0 Kudos

Issue resolved... i made use of different APIs and the thing is working now...

IConnection API still doesnt work for unknown reason.. but have managed to work it around...

Thank u guys for your inputs...

Former Member
0 Kudos

Hi Devashish,

see forum thread.

I had raised the question sometime back. It might help you.

regards,

Mausam

Former Member
0 Kudos

Please tell how did you solve .

we have similar issue.

Thanks a lot

Rahul

Former Member
0 Kudos

Hi,

I was using IConnection API...

Then i stopped using IConnection API and started using MDM4J APIs.. of fetching CatalogData.

Any more explanations, do write bak...

-Dev