As far as my testing goes, this has always been possible with JBoss 3.0. The binding is a bit unexpected though, which might have stopped a few people from getting it working (including myself till 10 min. ago ;-)
All local homes seem to be bound as "local/<ejb-name>". So, if you have got a bean named CurrencyBean with a local home CurrencyHome, you would look it up like this:
InitialContext ic = new InitialContext();
CurrencyHome c = (CurrencyHome) ic.lookup("local/CurrencyBean");
Please note that there is no "java:" or "java:comp/env" or so involved here.
Kind regards, Wilfried
You may also want to note that you can redefine the local interface JNDI name in jboss.xml with <local-jndi-name>. For example:
so instead of....
you can do....
This was not in the dtd. I'm not sure if it' still not there, but you should be able to use it.
Two great answers !!
However, the following questions seem to be left open:
Using local-jndi-name do I need ejb-local-ref in my servlet ?
Should lookup via "local/Beanname" work without any reference in my servlet ?
(using jboss3/jetty from cvs)
local-jndi-name will redefine the global jndi name. You can either use the global name or use a reference defined with ejb-local-ref. However, the last I know of, Jetty does not support <ejb-local-ref>. But this may have changed recently.