Last week, we had the author of TDD for a Shopping Website LiveProject. Friday at 11am Ranch time, Steven Solomon will be hosting a live TDD session just for us. See for the agenda and registration link
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Jeanne Boyarsky
  • Tim Cooke
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Frits Walraven
Bartenders:
  • Piet Souris
  • Himai Minh

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

 
Ranch Hand
Posts: 154
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Ranch Hand
Posts: 906
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
PI day is 3.14 (march 14th) and is also einstein's birthday. And this is merely a tiny ad:
free, earth-friendly heat - a kickstarter for putting coin in your pocket while saving the earth
https://coderanch.com/t/751654/free-earth-friendly-heat-kickstarter
reply
    Bookmark Topic Watch Topic
  • New Topic