cancel
Showing results for 
Search instead for 
Did you mean: 

EJB lookup failure??

Former Member
0 Kudos

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

Accepted Solutions (0)

Answers (1)

Answers (1)

kishorg
Advisor
Advisor
0 Kudos

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

Former Member
0 Kudos

Thanks Kishor for the helful information