Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

client application connecting to local server after failing to connect to remote server

 
naveen tirumalasetty
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi,
I am seeing a strange problem in getting reference of initial context. client application supposed to make remote method (sync) call to remote server. it is working fine normally. but when connection is lost between remote server and client, it is failing to get initial context (which is fine as it is expected). But after a while when connection is re-established client application is connecting to local server instead of remote server (means it is getting reference of wrong initial context). btw, local and remote server both have same port number.
I am wondering if anyone has seen this problem. Here I am pasting the code that gets initial context.

Properties props = new Properties();
props.setProperty("java.naming.factory.initial",
"com.sun.enterprise.naming.SerialInitContextFactory");
props.setProperty("java.naming.factory.url.pkgs", "com.sun.enterprise.naming");
props.setProperty("java.naming.factory.state",
"com.sun.corba.ee.impl.presentation.rmi.JNDIStateFactoryImpl");
props.setProperty("org.omg.CORBA.ORBInitialHost", remoteLocation);
props.setProperty("org.omg.CORBA.ORBInitialPort", String.valueOf(remotePort));
jndiContext = new InitialContext(props);

-naveen
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic