Yes, the ejb-link tag is the ejb-name of the referenced bean (as specified
in another section of the deployment descriptor). The ejb-ref-name is the
jndi name, relative to java:comp/env. Thus, perhaps a better example would
have been:

<ejb-ref-name>ejb/WhateverIWant</ejb-ref-name>
...
<ejb-link>OtherEJBName</ejb-link>


and then in the code
jndiCtx.lookup("java:comp/env/ejb/WhateverIWant")
will return the home interface of the bean named OtherEJBName.

Also note that the ejb/ prefix in the ejb-ref-name is not required, just
suggested by the spec.



|--------+-------------------------------------->
|        |          "danch (Dan Christopherson)"|
|        |          <[EMAIL PROTECTED]>          |
|        |          Sent by:                    |
|        |          [EMAIL PROTECTED]|
|        |          eforge.net                  |
|        |                                      |
|        |                                      |
|        |          07/05/01 02:23 PM           |
|        |          Please respond to jboss-user|
|        |                                      |
|--------+-------------------------------------->
  
>-----------------------------------------------------------------------------------------------------------|
  |                                                                                    
                       |
  |       To:     [EMAIL PROTECTED]                                     
                       |
  |       cc:                                                                          
                       |
  |       Subject:     Re: [JBoss-user] EJB question                                   
                       |
  
>-----------------------------------------------------------------------------------------------------------|




I believe the ejb-link tag is the ejb-name, not necessarily the
jndi-name for the bean.

[EMAIL PROTECTED] wrote:

> You should declare a reference to the entity bean in the deployment
> descriptor, like this:
>
>
> <session>
> ...
>   <ejb-ref>
>     <ejb-ref-name>ejb/LogEventInfo</ejb-ref-name>
>     <ejb-ref-type>Entity</ejb-ref-type>
>     <home>com.trilogy.tbs.logging.LogEventInfoHome</home>
>     <remote>com.trilogy.tbs.logging.LogEventInfo</remote>
>     <ejb-link>LogEventInfo</ejb-link>
>   </ejb-ref>
> </session>
>
> This way, you will code your session bean so that it always does a lookup
> like:
>
> jndiCtx.lookup("java:comp/env/ejb/LogEventInfo");
>
> This way, if the entity bean is ever deployed with a different name, all
> you have to do is change the ejb-link tag to point to the new name.
>
> Alex



_______________________________________________
JBoss-user mailing list
[EMAIL PROTECTED]
http://lists.sourceforge.net/lists/listinfo/jboss-user





_______________________________________________
JBoss-user mailing list
[EMAIL PROTECTED]
http://lists.sourceforge.net/lists/listinfo/jboss-user

Reply via email to