Getting exception while runningthe  client program. Root exception is javax.naming.NameNotFoundException...

Posted on 2006-04-10
Last Modified: 2013-12-10

I deployed a simple ejb application on to the weblogic server but when I run the client program, I am getting the following error

before lookup
Exception in thread "main" javax.naming.NameNotFoundException: Unable to resolve
 'HelloHome'. Resolved '' [Root exception is javax.naming.NameNotFoundException:
 Unable to resolve 'HelloHome'. Resolved '']; remaining name 'HelloHome'
        at weblogic.rjvm.ResponseImpl.unmarshalReturn(
        at weblogic.rmi.cluster.ClusterableRemoteRef.invoke(ClusterableRemoteRef
        at weblogic.rmi.cluster.ClusterableRemoteRef.invoke(ClusterableRemoteRef
        at weblogic.jndi.internal.ServerNamingNode_910_WLStub.lookup(Unknown Sou
        at weblogic.jndi.internal.WLContextImpl.lookup(
        at weblogic.jndi.internal.WLContextImpl.lookup(
        at javax.naming.InitialContext.lookup(Unknown Source)
        at examples.HelloClient.main(
Caused by: javax.naming.NameNotFoundException: Unable to resolve 'HelloHome'. Re
solved ''
        at weblogic.jndi.internal.BasicNamingNode.newNameNotFoundException(Basic
        at weblogic.jndi.internal.BasicNamingNode.lookupHere(BasicNamingNode.jav
        at weblogic.jndi.internal.ServerNamingNode.lookupHere(ServerNamingNode.j
        at weblogic.jndi.internal.BasicNamingNode.lookup(
        at weblogic.jndi.internal.RootNamingNode_WLSkel.invoke(Unknown Source)
        at weblogic.rmi.internal.BasicServerRef.invoke(
        at weblogic.rmi.cluster.ClusterableServerRef.invoke(ClusterableServerRef
        at weblogic.rmi.internal.BasicServerRef$
        at weblogic.rmi.internal.BasicServerRef.handleRequest(BasicServerRef.jav
        at weblogic.rmi.internal.BasicServerRef.access$300(
        at weblogic.rmi.internal.BasicServerRef$
        I am giving my client program and deployment descriptors.
        package examples;
      import javax.naming.Context;
      import javax.naming.InitialContext;
      import java.util.Properties;
      public class HelloClient {
            public static void main(String[] args) throws Exception {
                  //Properties prop = System.getProperties();
                  Properties prop = new Properties();
                  Context ctx = new InitialContext(prop);
                  System.out.println("before lookup");
                  Object obj = ctx.lookup("HelloHome");
                  System.out.println("after lookup");
                  HelloHome home = (HelloHome) javax.rmi.PortableRemoteObject.narrow(obj, HelloHome.class);
                  Hello hello = home.create();

my xml files


<!DOCTYPE ejb-jar PUBLIC "-//Sun Microsystems, Inc.//DTD Enterprise JavaBeans 2.0//EN" "">



<!DOCTYPE weblogic-ejb-jar PUBLIC "-//BEA Systems, Inc.//DTD WebLogic 6.0.0 EJB//EN" "">
After compiling the java files, I created the jar file that includes xml files and classfiles.  Then using weblogic.ejbc I created the jar file
which I deployed in the weblogic server. I used weblogic admin console to deploy.

Until this point there was no error but when I run the client, I get the above said error.

My ejb files structure is as follows

my directory/java files
            /examples/class files
I am new to weblogic. I will be thankful if anybody can tell me where did I go wrong and help me out in solving the problem.

Thanks in Advance.


Question by:savita_gomatam
    LVL 10

    Accepted Solution


    are you sure that your ejb is correctly deployed in the server ? Check the JNDI tree.

    Author Comment


    Thanks for the response.
    Yes. It is deployed correctly.  Now it is working.  I didn't start the ejb in the weblogic server.  

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    How to run any project with ease

    Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
    - Combine task lists, docs, spreadsheets, and chat in one
    - View and edit from mobile/offline
    - Cut down on emails

    Configure Web Service (server application) I. Configure security for Web Services methods First, we need to protect Session bean which implements the service: 1. Open EJB deployment descriptor (ejb-jar.xml) in the EJB project that contains you…
    This exercise is about for the following scenario: Dmgr and One node with 2 application server. Each application server contains it owns application. Application server name as follows server1 contains app1 server2 contains app1 Prereq…
    Hi everyone! This is Experts Exchange customer support.  This quick video will show you how to change your primary email address.  If you have any questions, then please Write a Comment below!
    Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

    759 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    12 Experts available now in Live!

    Get 1:1 Help Now