This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes EJB and other Java EE Technologies and the fly likes How can we resolve NameNotFoundException? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Bookmark "How can we resolve NameNotFoundException?" Watch "How can we resolve NameNotFoundException?" New topic

How can we resolve NameNotFoundException?

Kamal hasan

Joined: Mar 11, 2007
Posts: 4
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)
Properties p = new Properties();
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();
catch(Exception 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.
Ryan Fernandes
Ranch Hand

Joined: Dec 11, 2003
Posts: 86
How about trying to list the jndi tree and checking if your bean is deployed correctly. This should also help you locate it and get the 'name' of the bean.


Unthinking respect for authority is the greatest enemy of truth. -Albert Einstein, physicist, Nobel laureate (1879-1955)
I agree. Here's the link:
subject: How can we resolve NameNotFoundException?
Similar Threads
How can I solve NameNotFoundException?
HFEJB - Basic Question from
Trouble running Advice EJB
Weblogic with Ejb, HFEJB
WebLogic server-not getting the component interface right