Title: ORMI with RMIInitialContextFactory fails when server shutdowns


I am trying to lookup a ejb running on a remote app server, and I am using the following settings which are posted at the end of the page,

when the remote server is running everything works fine, but when the remote server is down, the application/client fetches the local instance, though I am using the ormi and specifying to connect to the remote server, I face this problem when I work with a same EJB which is deployed in the two different servers and with the same application name. one more thing is I do not want to use the remote="true" as the same ejb is needed in the local machine for another applications and pages

so I want to know how to stop the server to pick the local instance when the remote server is not running.

Properties p = new Properties();
p.put(Context.INITIAL_CONTEXT_FACTORY, "com.evermind.server.rmi.RMIInitialContextFactory");
p.put(Context.PROVIDER_URL, "ormi://");
p.put(Context.SECURITY_PRINCIPAL, "admin");
p.put(Context.SECURITY_CREDENTIALS, "123");
Context ctx = new InitialContext(p);
Object obj = ctx.lookup("hello.ejb.Hello");


Reply via email to