Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

java:comp/env/ejb/jndi-name.

 
Vin Kris
Ranch Hand
Posts: 154
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Ranchers
I am trying to configure my application to invoke one EJB from another. I am trying to use <ejb-ref> tag in ejb-jar.xml (using WSAD 4.0.3). But i'm not able to look-up the ejb.
My questions:
1) <ejb-ref-name> is the JNDI name. isn't it?
2) if I give the value for above as "MyEJB", then do I have to look-up as "java:comp/env/ejb/MyEJB" ? Is this the case for remote EJBs only (in a diff. container) or for local EJBs also (same container)?
I am confused with using the JNDI. Any assistance is appreciated. Could somebody please point me in the right direction. good ol' Google is consuming a lot of time.
Thanks.
 
Nitzan Levi
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
1. no. the ref name is the name that you will use form java:comp. in the websphere bindings there's the mapping between the ref name and the jndi name.
so lets say your ref anme is MyEjb so you will access it from java:comp/env/MyEjb.
2.it is true for both local or remote , but they need to be stored in the same jndi server.
 
JeanLouis Marechaux
Ranch Hand
Posts: 906
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Vin,
One question here.
Are you trying to test your lookup within WSAD (I mean WTE) or from a deployed application onto WebSphere ?
Unfortunately, it does not work exactly the same way in both.
Your code will lookup from "java:comp/env/ejb/MyEJB". But as its name says, it is a reference. Once deployed, you have to map a real EJB/JNDI name to this reference.
With WebSphere, this is done during the deployment process or thu the "EJB reference" tabpage of the admin console.
With WSAD, as far as I know, there is no UI to do it. But I hopethis IBM document could help you
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic