This has been discussed many times on the mailing list. env.put("dedicated.connection","true");
Also see: http://bugzilla.orionserver.com/bugzilla/show_bug.cgi?id=738 Cheers, Scott Jesper Rasmussen wrote: > Hi all, > Im trying to make an application which askes for the login and password > to connect to the application deployed on 1.5.4 orion server. > > It works fine if i specify the correct login(admin). However if I uses > some wrong cridentials(admin1) i get an exception which also is fine. > > HOWEVER when i try to login again, without restarting the application) > using the correct info I still get the old exception > (javax.naming.AuthenticationException: Invalid username/password for > beansApp (admin1)). > > If i close the app and login again with the correct it works fine. > > to me it seems like the enviroment i pass to the constructor of > InitialContext is ignored the second time. > > I have tried to use close() to no avail. > > Does anyone have a clue?? Thanks! > > cheers > JEsper > > ----------more or less the code that cause the bug! > server="ormi://127.0.0.1/beansApp"; > login="admin1"; > password="123"; > env = new java.util.Hashtable(); > env.put("java.naming.provider.url",server); > env.put("java.naming.factory.initial","com.evermind.server.ApplicationCl > ientInitialContextFactory"); > env.put("java.naming.security.principal",login); > env.put("java.naming.security.credentials",password); > InitialContext initial; > > try { > initial = InitialContext(env); > catch(NamingException e) { > try { > login="admin"; > env = new java.util.Hashtable(); > env.put("java.naming.provider.url",server); > > env.put("java.naming.factory.initial","com.evermind.server.ApplicationCl > ientInitialContextFactory"); > env.put("java.naming.security.principal",login); > env.put("java.naming.security.credentials",password); > } catch(NamingException ex) { > //ACK. chould not get here!!! > } > -- Scott Farquhar :: [EMAIL PROTECTED] Atlassian :: http://www.atlassian.com Supporting YOUR J2EE World