Skip to Content
avatar image
Former Member

EJB lookup failure??

Hi experts,

I have deployed an enterprise application on Sneak Preview of WebAS , has EJB and a Web Module. the web module tries to look up an EJB which is configured to have the JNDI name

com.xxx.xxx.ejb.HelperBean.

Servlet tries a lookup with

Object ref =ctx.lookup(
"java:comp/env/ejb/com.xxx.xxx.ejb.HelperBean");

<b>Question 1. Is the lookupname specified above right?</b>

The lookup fails giving a NameNotFoundException.

<b>Question 2. Is it possible to check if my EJB was bound properly in the namespace?

Something like <b><i>dumpnamespace</i></b> in WebSphere

</b>

Regards,

Amol

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

1 Answer

  • Mar 28, 2006 at 01:20 PM

    Hi Amol,

    U can try this..

    In the EJB project double click the ejb-j2ee-engine.xml file . Then in the Enterprise Beans Tab , u can see the EJBs in ur EJB project in 3 sessions like session bean , entity bean and message driven bean.

    From this select ur particular bean . then in the right pane , u can give the JNDI name for that ejb.

    Give like this..

    for example...

    JNDI Name = testJNDI

    then u can look up like this ...

    <u>a) for Remote Home Object</u>

    Object ref =ctx.lookup("<b>testJNDI</b>");

    <u>b) For Local Home object</u>

    Object ref =ctx.lookup("<b>localejbs/testJNDI</b>");

    use like this in ur servlet code...

    U can see the JNDI names in the JNDI registry of hur WAS.

    This JNDI registry u can see through ,

    Visual Administrator or Web Admin ..

    ur JNDI name will come under the EAR project ,in which ur EJB is present.

    Regards

    Kishor Gopinathan

    Add comment
    10|10000 characters needed characters exceeded