users@glassfish.java.net

client app connecting to local server after failing con. to remote server

From: <glassfish_at_javadesktop.org>
Date: Tue, 31 Mar 2009 19:26:18 PDT

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 reestablished 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);

Any help is very much appreciated.
Thank you, Nav.
[Message sent by forum member 'tsnaveen' (tsnaveen)]

http://forums.java.net/jive/thread.jspa?messageID=339955