Problem with Naming.Lookup

My problem:

-

I will be continuously request the Server : for status whether it is running or not. In middel of the request, If i close RMI Server,

The method "Naming.Lookup" execution is taking 5 to 10 min time to get out . And some times not releasing.

Is there is any solution ?

[313 byte] By [krishnavcha] at [2007-11-26 13:00:34]
# 1
Naming.lookup should take a second or two at most. Any more indicates a problem in your DNS setup.OTOH why are you doing all these lookups? A successful result doesn't actually indicate that the server is still there. You should add a liveness method to the server itself.
ejpa at 2007-7-7 17:01:07 > top of Java-index,Core,Core APIs...
# 2
How to get an instance of server Without context.lookup(name) method.Is there any other way to get an server instance..
kpsamya at 2007-7-7 17:01:07 > top of Java-index,Core,Core APIs...
# 3

When I connect from

Client

Remote Desktop Client

Server:

SUN JAVA SYSTEM APPLICATION SERVER 9.0

Initial Context object is initialized as per below coding,

System.setProperty("org.omg.CORBA.ORBInitialHost", prop.getProperty("hostName"));

System.setProperty("org.omg.CORBA.ORBInitialPort", prop.getProperty("portNumber"));

InitialContext ctx = new InitialContext();

while .lookup("globalJndiNameForSessionBean") method is invoked on the InitialContext object and if the server is not available, it is throwing non stop error.

Please tell me wether I have to add any other Properties to limit the time of lookup and make the method to throw an Exception after two or three second, if the server is not available.

kpsamya at 2007-7-7 17:01:07 > top of Java-index,Core,Core APIs...
# 4
This question has nothing to do with the original post or poster. Please don't hijack threads.
ejpa at 2007-7-7 17:01:07 > top of Java-index,Core,Core APIs...
# 5
ok..... thanks for your comments...let i post it in different query......
kpsamya at 2007-7-7 17:01:07 > top of Java-index,Core,Core APIs...