Hi ,
you have to set the environment settings.
.....<sample code>........
public class Client{
public static void main(String[] args){
new Client().doAction();
}
public void doAction() throws Exception{
InitialContext ctx=getInitialContext();
Object obj= ctx.lookup(jndiName);
home=(YOURHOME)PortableRemoteObject.narrow(obj,YOURHOME.class);
remote=home.create();
}
public InitialContext getInitialContext() throws NamingException{
Hashtable hs= new Hashtable();
hs.put("java.naming.factory.initial","com.sun.jndi.cosnaming.CNCtxFactory");
hs.put("java.naming.provider.url","iiop://127.0.0.1");
hs.put(Context.SECURITY_PRINCIPAL,"j2ee");
hs.put(Context.SECURITY_CREDENTIALS,"j2ee");
return new InitialContext(hs);
}
}
i am working in sun one application server. it is working in sun one appli server. try to execute this one, hope j2ee also support this one.
If any one find any problem or any error/ wrong in this approach , your suggestions are most welcome.
Thanks and regards
Anna Madhusudnanan