Hello everybody.
I have a problem.
I am write a standalone application client (without ACC) for accessing to EJB.
In my application connection params setted in a dialog.
I am successfully connect using it in this manner:
Hashtable<String,String> env = new Hashtable<String,String>();
env.put(Context.INITIAL_CONTEXT_FACTORY, "com.sun.enterprise.naming.SerialInitContextFactory");
env.put(Context.URL_PKG_PREFIXES, "com.sun.enterprise.naming");
env.put(Context.STATE_FACTORIES, "com.sun.corba.ee.impl.presentation.rmi.JNDIStateFactoryImpl");
env.put("org.omg.CORBA.ORBInitialHost", "localhost");
env.put("org.omg.CORBA.ORBInitialPort", 3700);
try
{
context=new InitialContext(env);
}
catch (NamingException e)
{
processingError(e, PLUGIN_ID, 0);
}
and looking up beans... it's work.
But after successfull (or not) connection i am change a connection settings to another (host/port) and try again lookup bean. Lookup process use the previous settings (host/port).
To change settings i am use code above with different environment
env.put("org.omg.CORBA.ORBInitialHost", "localhost1");//For example
env.put("org.omg.CORBA.ORBInitialPort", 3701);//For example
context=new InitialContext(env);
How to change connection settings?
[Message sent by forum member 'chidar' (chidar)]
http://forums.java.net/jive/thread.jspa?messageID=265541