on 03-28-2006 7:38 AM
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
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
81 | |
24 | |
11 | |
9 | |
7 | |
5 | |
5 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.