Hi,
I got the javax.naming.NameNotException : AdviceBean in my
ejb local client I have given the complete program below.
import javax.naming.*;
import java.util.*;
public class AdviceClient
{
public static void main(
String[] args)
{
try
{
Properties p = new Properties();
p.put(Context.INITIAL_CONTEXT_FACTORY,"com.sun.jndi.fscontext.RefFSContextFactory");
p.put(Context.PROVIDER_URL,"file:///e:/kramesh-java/ejb/Advice-EJB/classes/headfirst"); //1099
Context context = new InitialContext(p);
Object o=context.lookup("AdviceLocalHome");
System.out.println("home object has been brought");
AdviceLocalHome home=(AdviceLocalHome)o;
AdviceLocal advice=home.create();
System.out.println(advice.getAdvice());
}
catch(Exception ex)
{
ex.printStackTrace();
//System.out.println(ex);
}
}
}
I have the component interface "AdviceLocal"
the home interface "AdviceLocalHome"
the bean implementation class "AdviceBean"
we do the lookup for home interface "AdviceLocalHome".if so, what is the JNDI name for "AdviceLocalHome"?Are the home interface class name and the JNDI name same?How to set JNDI name in netbeans
IDE for local home interface and make the lookup?
help me solve this long time problem.