Discussions

EJB programming & troubleshooting: Naming Exception

  1. Naming Exception (3 messages)

    I am trying to create a stateless session bean. When I run the client, I am getting the following exception. Can anyone help me out please.

    javax.naming.NameNotFoundException: Unable to resolve test. Resolved:'' Unresolved:'test' ; remaining name ''
            at weblogic.rmi.internal.BasicOutboundRequest.sendReceive(BasicOutboundR
    equest.java:85)
            at weblogic.rmi.cluster.ReplicaAwareRemoteRef.invoke(ReplicaAwareRemoteR
    ef.java:262)
            at weblogic.rmi.cluster.ReplicaAwareRemoteRef.invoke(ReplicaAwareRemoteR
    ef.java:229)
            at weblogic.rmi.internal.ProxyStub.invoke(ProxyStub.java:35)
            at $Proxy0.lookup(Unknown Source)
            at weblogic.jndi.internal.WLContextImpl.lookup(WLContextImpl.java:339)
            at javax.naming.InitialContext.lookup(Unknown Source)
            at client.main(client.java:40)

    Thanks in advance

    Threaded Messages (3)

  2. Questions[ Go to top ]

    A few questions

    What are you trying to resolve?
       If its a bean I'd expect code like (for Websphere)

            Properties p = new Properties();

    //The JNDI properties you set depend
    //on which server you are using.
    p.put(Context.INITIAL_CONTEXT_FACTORY, "com.ibm.websphere.naming.WsnInitialContextFactory");
    p.put(Context.PROVIDER_URL,
    "iiop://localhost:2809");
    p.put("java.naming.security.principal", "user");
    p.put("java.naming.security.credentials", "password");

            
    try {
    InitialContext ic = new InitialContext(p);
    Object objRef = ic.lookup("ejb/com/company/Mybean");
    javax.ejb.EJBHome objHome = (javax.ejb.EJBHome)
                         PortableRemoteObject.narrow(objRef,
                                 Mybean.class);
            ....

    Have you configured your server with the corresponsing JNDI entries for the bean or whatever else you are looking up?

    Which application server are you using ?
  3. Thanks[ Go to top ]

    I was able to find out the problem. Thanks for the response.
  4. info...[ Go to top ]

    Hello,

     Am facing the same problem, could you please let me know of the exact problem because of which this is happening, and what was done to fix it.

    many thanks.