aspose file tools*
The moose likes Websphere and the fly likes URGENT Please!!!    JNDI Naming   :) Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Products » Websphere
Bookmark "URGENT Please!!!    JNDI Naming   :)" Watch "URGENT Please!!!    JNDI Naming   :)" New topic
Author

URGENT Please!!! JNDI Naming :)

Darryl Perrett
Greenhorn

Joined: Jul 30, 2002
Posts: 1
I've got a question about JNDI Naming... I set up my EJB Modules with a reference name such as '/ejb/MyEJBModule' and doing a lookup on this name works fine. My question is, how can the lookup also locate the resource using the 'java:comp/env' root context? (ie: 'java:comp/env/ejb/MyEJBModule'). Does the lookup assume the 'java:comp/env' root context as default for all environment variables? Any help would be appreciated
[ July 30, 2002: Message edited by: Darryl Perrett ]

Sun Certified Java Programmer<br />IBM Certified Specialist VAJ<br />IBM Certified Specialist WAS
Vinod Bijlani
Ranch Hand

Joined: Mar 06, 2002
Posts: 133
Yes all the env variables are prefixed with 'java:comp/env'
JeanLouis Marechaux
Ranch Hand

Joined: Nov 12, 2001
Posts: 906
The 'java:comp/env' is the specified prefix for variables, as it is mentioned in the J2EE spec


/ JeanLouis<br /><i>"software development has been, is, and will remain fundamentally hard" (Grady Booch)</i><br /> <br />Take a look at <a href="http://www.epfwiki.net/wikis/openup/" target="_blank" rel="nofollow">Agile OpenUP</a> in the Eclipse community
pjoisha
Ranch Hand

Joined: Mar 06, 2001
Posts: 123
What you need to do is first create this ejb-ref in your ejb-jar.xml (in the References tab) and then map that ejb-ref (like /ejb/MyEJB) to the Global JNDI name of the component (like '/ejb/com/mycompany/sample/MyEJBModule/mySampleEJBHome') u are trying to refer.
You tie this in the extensions editor (bindings tab). Once you have done this you can then start using the local JNDI names like this in ur code ...
context.lookup("java:comp/env/ejb/MyEJB");
Hope that helps.
PJ
Oh BTW ... this discussion is relevant to WSAD ... but the idea is the same if ur were to hand code ejb-jar.xml and ibm-ejb-jar-bnd.xmi.
[ July 31, 2002: Message edited by: Prashanth Joisha ]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: URGENT Please!!! JNDI Naming :)
 
Similar Threads
Packaging an EAR
database connection from JNDI
Fibonacci tutorial
EJB lookup
Lookup strings question