-
1. Re: JBOSS JNDI InitialContext
rockinryan Sep 18, 2002 6:44 PM (in response to corywilkerson)I see this question "got no love" so I figured I'd take a stab at it. : )
Based on my observations, you start out with access to "java:/comp/env" The /ejb is definitely not a given and it's use depends on your deployment descriptor. This may only work for LOCAL interfaces but in my last project I was able to connect to my home interface with no prefix at all:
x = (UserLocalHome)jndiContext.lookup("UserLocal");
In another case I used the equiv. of "java:/come/env/UserLocal"
If you need specifics on the deployment descriptor let me know and I can dig deeper with a better example.
Good luck,
Ryan -
2. Re: JBOSS JNDI InitialContext
rockinryan Sep 18, 2002 7:39 PM (in response to corywilkerson)I posted a reply to this earlier (that has not yet appeared in this thread). Since then I found an answer that was less speculative in the O'Reilly JBoss 3.0 Workbook by Bill Burke and Sacha Labourey.
Since I already manually paraphrased what he says there (I tried to post this message and it got completely lost) I'm gonna be very brief since I hate typing stuff twice due to computer-suckage.
Basically JBoss uses the <ejb-name> as the default binding to the HOME interface. (This tag goes in a jboss.xml file, see the thread I'll reference below or any number of other examples of how to write and where to place jboss.xml.) If you want to specify your own you can use a <jndi-name> entry just below the <ejb-name> entry in jboss.xml. So if you wanted your bean to show up in java:/comp/env/ejb/MyBean you should be able to use <jndi-name>ejb/MyBean</jndi-name>, otherwise just plan on using "MyBean" as it is the default. My first posting demonstrates this as a JDNI lookup more clearly. I'm sure it will appear on your thread within a few hours if it hasn't already.
I recommend both the Workbook and the book to which it is a companion. Please view this thread:
http://www.jboss.org/modules/bb/index.html?module=bb&op=viewtopic&t=forums/ to download the book and learn more.
good luck,
Ryan