-
1. Re: JNDI problem with local bean
adrian.brock Mar 22, 2002 3:20 PM (in response to alice_adler01)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>
ejb-jar.xml
[pre]
<ejb-name>AddressBean</ejb-name>
<ejb-name>EmployeeBean</ejb-name>
<ejb-local-ref>
<ejb-ref-name>ejb/Add</ejb-ref-name>
<ejb-ref-type>Entity</ejb-ref-type>
<local-home>alice.proj1.AddressLocalHome</local-home>
alice.proj1.AddressLocal
<ejb-link>AddressBean</ejb-link>
</ejb-local-ref>
[/pre]
jboss.xml:
[pre]
<ejb-name>AddressBean</ejb-name>
<jndi-name>proj1/Add</jndi-name>
<configuration-name></configuration-name>
<ejb-name>EmployeeBean</ejb-name>
<jndi-name>proj1/Emp</jndi-name>
<configuration-name></configuration-name>
[/pre]
You generally don't need local with JBoss. It will
use local automagically unless you turn the optimization
off.
Also, you might want to use "java:comp/env/ejb/Add"
to make it obvious you are using an <ejb-ref>.
Regards,
Adrian -
2. Re: JNDI problem with local bean
alice_adler01 Mar 22, 2002 3:59 PM (in response to alice_adler01)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. -
3. Re: JNDI problem with local bean
adrian.brock Mar 22, 2002 4:10 PM (in response to alice_adler01)I normally post this link about once a week :-)
http://www.jboss.org/online-manual/HTML/ch07s13.html
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.
Regards,
Adrian -
4. Re: JNDI problem with local bean
alice_adler01 Mar 22, 2002 7:39 PM (in response to alice_adler01)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 ..
Thanks again -
5. Re: JNDI problem with local bean
adrian.brock Mar 22, 2002 8:28 PM (in response to alice_adler01)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.
Regards,
Adrian