I believe NameNotFoundException only comes when your Container is
not able to locate your Bean in the registry using your JNDI
name.

Check out JNDI name which is used for lookup of the Bean...

On Thu, 06 Feb 2003 Ravi Kochher wrote :
MessageHi,

I am using a sessionless bean called abcEjb.

When I do the remote lookup, I get the following exception.



Unable to resolve 'abcEJBHome' Resolved: ''
Unresolved:'abcEJBHome'
javax.naming.NameNotFoundException: Unable to resolve
'abcEJBHome' Resolved: '' Unresolved:'abcEJBHome' ; remaining
name 'abcEJBHome'
 at
weblogic.rmi.internal.BasicOutboundRequest.sendReceive(BasicOutboundRequest.java:109)
 at
weblogic.rmi.cluster.ReplicaAwareRemoteRef.invoke(ReplicaAwareRemoteRef.java:262)
 at
weblogic.rmi.cluster.ReplicaAwareRemoteRef.invoke(ReplicaAwareRemoteRef.java:229)
 at
weblogic.jndi.internal.ServerNamingNode_WLStub.lookup(Unknown
Source)
 at
weblogic.jndi.internal.WLContextImpl.lookup(WLContextImpl.java:337)
 at
weblogic.jndi.internal.WLContextImpl.lookup(WLContextImpl.java:332)
 at
javax.naming.InitialContext.lookup(InitialContext.java:347)
 at abcEJBClient.main(abcEJBClient.java:33)
Process Exit...



Please help.

Regards
Ravi


I am using the following code in the client.


//package abcEJBTest;

import java.rmi.RemoteException;
import javax.ejb.*;
import javax.naming.*;
import javax.rmi.PortableRemoteObject;
import java.util.*;

public class abcEJBClient
{
 public static void main(String[] args)
 {
  InitialContext context = null;
  try
  {

   Hashtable ht = new Hashtable();
   ht.put(Context.INITIAL_CONTEXT_FACTORY,
            "weblogic.jndi.WLInitialContextFactory");

   System.out.println("Hi1");

   ht.put(Context.PROVIDER_URL,
        "t3://localhost:7001");
   ht.put(Context.SECURITY_PRINCIPAL, "rkochher");
   ht.put(Context.SECURITY_CREDENTIALS, "rkochher");

   System.out.println("Hi2");

   context = new InitialContext(ht);

   //String strBean = new String(abcEJBHome);
   Object homeObject = context.lookup("abcEJBHome"); //this is
the problematic line

   System.out.println("Hi3");

   abcEJBHome home =
(abcEJBHome)PortableRemoteObject.narrow(homeObject,
abcEJBHome.class);

   abcEJB abcEJB =
(abcEJB)PortableRemoteObject.narrow(home.create(),
abcEJB.class);

   System.out.println(abcEJB.abcEJB());

  }
  catch(RemoteException e)
  {
   System.err.println("System/communication error: " +
e.getMessage());
   e.printStackTrace();
  }
  catch(NamingException e)
  {
   System.err.println("Communication error: " +
e.getMessage());
   e.printStackTrace();
  }
  catch(CreateException e)
  {
   System.err.println("Error creating cart: " +
e.getMessage());
   e.printStackTrace();
  }
  finally
  {
   try {context.close();}
   catch (Exception e)
   {
    e.printStackTrace();
   }
     // a failure occurred
  }
 }
}

===========================================================================
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff EJB-INTEREST".  For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".

Reply via email to