Cant I type cast like this directly ..
code: loginHome = (LoginHome)context.lookup("java:comp/env/LoginBean");
You can safely cast the LocalHome interface but only when you 're sure it's local interface. For remote interfaces, you will need to use PortableRemoteObject.narrow(homeObject). (That's because of the IIOP protocol used)
The same client was working in weblogic, After the server is migrated to oracle10g i'm facing this exception.
Oracle uses the special ORMI protocol (instead of RMI-IIOP) which is, in my opinion, the start of a lot of problems...
Anyway, the HashTable should look like:
Hashtable env = new Hashtable();
env.put(Context.INITIAL_CONTEXT_FACTORY,"com.evermind.server.rmi.RMIInitialContextFactory");
env.put(Context.SECURITY_PRINCIPAL, "jazn.com/admin");
env.put(Context.SECURITY_CREDENTIALS, "welcome");
env.put(Context.PROVIDER_URL, "ormi://localhost:<port>/ejbsamples");
Hope this was helpfull...
Cheers
[ November 14, 2004: Message edited by: Grand Puba ]