Also check the jndi name exactly matches with what you are looking up




                    Sameer Bhardwaj
                    <[EMAIL PROTECTED]        To:     [EMAIL PROTECTED]
                    HSPAN.COM>                        cc:     (bcc: 
ashwani.kalra/Polaris)
                    Sent by: A mailing list           Subject:     Re: Exception 
during lookup
                    for Enterprise JavaBeans
                    development
                    <[EMAIL PROTECTED]
                    >


                    02/07/2003 10:17 AM
                    Please respond to Sameer
                    Bhardwaj






ravi,
your bean has not been deployed properly ....
check logs for any errors and redeploy



regards


sameer


     -----Original Message-----
     From: Ravi Kochher [mailto:[EMAIL PROTECTED]]
     Sent: Thursday, February 06, 2003 7:46 PM
     To: [EMAIL PROTECTED]
     Subject: Exception during lookup

     Hi,

     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
       }
      }
     }



This e-Mail may contain proprietary and confidential information and is sent for the 
intended recipient(s) only.
If by an addressing or transmission error this mail has been misdirected to you, you 
are requested to delete this mail immediately.
You are also hereby notified that any use, any form of reproduction, dissemination, 
copying, disclosure, modification,
distribution and/or publication of this e-mail message, contents or its attachment 
other than by its intended recipient/s is strictly prohibited.

Visit Us at http://www.polaris.co.in

Reply via email to