Hi,
I am trying to run this program from Chapter2 of Professional EJB by WROX.
Code:
import javax.ejb.*;
import simpleBean.*;
import javax.naming.InitialContext;
class SalaryClient{
public static void main(String[] args){
try{
InitialContext ctx = new InitialContext();
Object objRef = ctx.lookup("Salary");
SalaryHome home = (SalaryHome) javax.rmi.PortableRemoteObject.narrow(objRef,SalaryHome.class);
Salary bean = home.create();
System.out.println("Monthly net salary: "+bean.calculateSalary(28000,2,500));
}
catch(javax.naming.NamingException ne){
System.out.println("Naming Exception caught: "+ne);
}
catch(Exception e){
System.out.println("Exception caught: "+e);
}
}
}
I am getting the following error:
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
Press any key to continue...
Can anybody help me on this please ????