Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium


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

Posted on 2006-04-10
Medium Priority
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(ResponseImpl.java:191)
        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(WLContextImpl.java:374)
        at weblogic.jndi.internal.WLContextImpl.lookup(WLContextImpl.java:362)
        at javax.naming.InitialContext.lookup(Unknown Source)
        at examples.HelloClient.main(HelloClient.java:23)
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(BasicNamingNode.java:20
        at weblogic.jndi.internal.RootNamingNode_WLSkel.invoke(Unknown Source)
        at weblogic.rmi.internal.BasicServerRef.invoke(BasicServerRef.java:517)
        at weblogic.rmi.cluster.ClusterableServerRef.invoke(ClusterableServerRef
        at weblogic.rmi.internal.BasicServerRef$1.run(BasicServerRef.java:407)
        at weblogic.security.acl.internal.AuthenticatedSubject.doAs(Authenticate
        at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:
        at weblogic.rmi.internal.BasicServerRef.handleRequest(BasicServerRef.jav
        at weblogic.rmi.internal.BasicServerRef.access$300(BasicServerRef.java:5
        at weblogic.rmi.internal.BasicServerRef$BasicExecuteRequest.run(BasicSer
        at weblogic.work.ExecuteThread.execute(ExecuteThread.java:207)
        at weblogic.work.ExecuteThread.run(ExecuteThread.java:179)
        I am giving my client program HelloClient.java 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" "http://java.sun.com/dtd/ejb-jar_2_0.dtd">



<!DOCTYPE weblogic-ejb-jar PUBLIC "-//BEA Systems, Inc.//DTD WebLogic 6.0.0 EJB//EN" "http://www.bea.com/servers/wls600/dtd/weblogic-ejb-jar.dtd">
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

ECollin earned 600 total points
ID: 16428762

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

Author Comment

ID: 16433690

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

Featured Post

[Webinar On Demand] Database Backup and Recovery

Does your company store data on premises, off site, in the cloud, or a combination of these? If you answered “yes”, you need a data backup recovery plan that fits each and every platform. Watch now as as Percona teaches us how to build agile data backup recovery plan.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

-Xmx and -Xms are the two JVM options often used to tune JVM heap size.   Here are some common mistakes made when using them:   Assume BigApp is a java class file for the below examples. 1.         Missing m, M, g or G at the end …
This article is about some of the basic and important steps to be used to improve the performance in web-sphere commerce application development. 1) Always leverage the Dyna-caching facility provided by the product 2) Remove the unwanted code …
This Micro Tutorial will teach you how to add a cinematic look to any film or video out there. There are very few simple steps that you will follow to do so. This will be demonstrated using Adobe Premiere Pro CS6.
Enter Foreign and Special Characters Enter characters you can't find on a keyboard using its ASCII code ... and learn how to make a handy reference for yourself using Excel ~ Use these codes in any Windows application! ... whether it is a Micr…
Suggested Courses

569 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