I think you want something more like the following.
Notice the order.
Also you don't need <ejb-ref> in jboss.xml if you
are using <ejb-link>
You generally don't need local with JBoss. It will
use local automagically unless you turn the optimization
Also, you might want to use "java:comp/env/ejb/Add"
to make it obvious you are using an <ejb-ref>.
Adrian, thanks for the help.
I did exactly as u told. Before I didn't think order of was important. Anyway, the thing even didn't work for me after changing the order etc.
Then I changed one more thing. In my EmployeeBean I changed my lookup call to:
AddressLocalHome home = (AddressLocalHome)jndiContext.lookup("local/AddressBean);
and it started working!! Didn't work with proj1/Add or ejb/Add. I am really confused about all this. Can someone please guide me where I can learn more about this jndi binding in JBoss and whats going on here??
Thanks a lot.
I normally post this link about once a week :-)
local/AddressBean is the default binding for a local
bean. You didn't specify the local jndi name.
Did you try the java:comp/env/ejb/Add version?
If you look back to early this week in this forum,
there are some posts about ejb-refs and local bindings.
They include links to some examples.
Thank u very much. I had already read the section u reffered to but it didn't talk about local-jndi-name. Neither did it talk about "local".. So its difficult for a person like me to figure all of it w/o help..
One more thing: Does the order of in ejb-jar matter? For example I declared EmployeeBean first that has a reference to AddressBean declared after it. It worked fine for me though ..
I don't think the order should matter.
I can't remember without looking at the code, but it
should create all the containers first and then link them.