When I try to create an InitialContext for a server that is
down, the timeout seems to take a very long time.  I have some
clients that never seem to time out.  Is there a way to specify
the timeout when trying to lookup a bean through the initial
context?
Here is a use case.  Note that the timeout will occur right away
if the host does not exist in DNS.  However, if the host does
exist (but there is no server running), the timeout takes a
really long time, and sometimes just never happens.
Thanks!
Patrick

------------------------------------------------------------
import javax.naming.Context;
import javax.naming.InitialContext;
import java.util.Hashtable;

public class EJBTimeout {
  public static void main(String args[]) {
    try {
      Hashtable env = new Hashtable();
      env.put(Context.INITIAL_CONTEXT_FACTORY,
"org.jnp.interfaces.NamingContextFactory");
      env.put(Context.PROVIDER_URL, "mail.yahoo.com");
      env.put(Context.URL_PKG_PREFIXES,
"org.jboss.naming:org.jnp.interfaces");
      InitialContext ctx = new InitialContext(env);
      
      Object obj = ctx.lookup("fakeObject");
      System.out.println("found Object");
    }
    catch (Throwable t) {
      t.printStackTrace();
    }
  }

}



-------------------------------------------------------
This SF.net email is sponsored by: IBM Linux Tutorials.
Become an expert in LINUX or just sharpen your skills.  Sign up for IBM's
Free Linux Tutorials.  Learn everything from the bash shell to sys admin.
Click now! http://ads.osdn.com/?ad_id=1278&alloc_id=3371&op=click
_______________________________________________
JBoss-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-user

Reply via email to