Naming Exception caught: javax.naming.NoInitialContextException: Need to specify class name in environment or system property, or as an
applet parameter, or in an application resource file: java.naming.factory.initial
--------Client Code-------------
import javax.ejb.*;
import hello.*;
import java.util.*;
import javax.naming.InitialContext;
class helloClient
{
public static void main(
String args[])
{
try
{
InitialContext ctx = new InitialContext();
Object objRef=ctx.lookup("HelloEJB");
HelloHome home=(HelloHome)javax.rmi.PortableRemoteObject.narrow(objRef, HelloHome.class);
HelloSonu bean=home.create();
System.out.println("Monthly net Salary: "+bean.sayHello());
}
catch(javax.naming.NamingException ne)
{
System.out.println("Naming Exception caught: " +ne);
}
catch(javax.ejb.CreateException ce)
{
System.out.println("Create Exception caught: " +ce);
}
catch(java.rmi.RemoteException re)
{
System.out.println("Remote Exception caught: " +re);
}
}
}
-------------Please help--------Using
j2ee server---------