-
1. Re: QUESTION:Packaging and deploying the Beans
seven Feb 11, 2002 8:55 AM (in response to gonso)In ejb-jar.xml u have
...
<ejb-name>CDBean</ejb-name>
...
and
....
<ejb-ref>
<ejb-ref-name>ejb/CD</ejb-ref-name>
<ejb-ref-type>Entity</ejb-ref-type>
org.jboss.docs.cmp.cd.interfaces.CDHome
org.jboss.docs.cmp.cd.interfaces.CD
<ejb-link>CDBean</ejb-link>
</ejb-ref>
....
the <ejb-ref-name>ejb/CD</ejb-ref-name> from the session description is the name used by the session bean code to locate the home of the entity:
Context initial = new InitialContext();
initial.lookup("ejb/CD");
<ejb-link> label is taken into account by the deployer to find the real entity bean. ejb/CD is private to the session bean. u can write anything instead of ejb/CD as long as u use the same path in the session bean code when u locate the home interface of the enrity bean:
<ejb-ref-name>bla/bla/bla/bla</ejb-ref-name>
and in code
Context initial = new InitialContext();
initial.lookup("bla/bla/bla/bla");
Furter, suppose u have another session bean that uses the entity bean, u can have:
<ejb-ref-name>xxx/xxx/xxx</ejb-ref-name>
and in code
Context initial = new InitialContext();
initial.lookup("xxx/xxx/xxx");
but <ejb-link>CDBean</ejb-link> has to remain the same.
In jboss.xml u have
<ejb-name>CDBean</ejb-name>
<jndi-name>cd/CD</jndi-name>
<configuration-name></configuration-name>
here is the real jndi name of the entity bean.if u want to access the entity bean directly (from a client and not from another session bean) u'll have to use this name to locate the home interface. -
2. Re: QUESTION:Packaging and deploying the Beans
gonso Feb 11, 2002 9:06 AM (in response to gonso)Thanks, seven!