That is not the correct understanding of the jndi-name element from the jboss.xml
descriptor. The docs show an example of an ejb-jar.xml of:
<ejb-jar>
  <enterprise-beans>
    <session>
      <ejb-name>Bean A</ejb-name>
      <home>AHome</home>
      <remote>A</remote>
      <ejb-class>ABean</ejb-class>
      <session-type>Stateful</session-type>
      <transaction-type>Container</transaction-type>
      <ejb-ref>
        <ejb-ref-name>ejb/myBean</ejb-ref-name>
        <ejb-ref-type>Entity</ejb-ref-type>
        <home>BHome</home>
        <remote>B</remote>
      </ejb-ref>
    </session>

  </enterprise-beans>
  ...
</ejb-jar>

with a jboss.xml of:
<jboss>
  <enterprise-beans>
    <session>
      <ejb-name>Bean A</ejb-name>
      <ejb-ref>
        <ejb-ref-name>ejb/myBean</ejb-ref-name>
        <jndi-name>t3://otherserver/application/beanB</jndi-name>
      </ejb-ref>
    </session>
  <enterprise-beans>
</jboss>

In the bean code the external EJB is retrieved from JNDI exactly the same as an 
internal
bean and the only JNDI names in the code are those used in the ejb-jar.xml descriptor:

    Context ctx = new InitialContext();
    BHome home = (BHome) ctx.lookup("java:comp/env/ejb/myBean");

The jndi-name value is only used by the deployment framework to specify what
the binding for the java:comp/env/ejb/myBean name is since this cannot be
specified via an ejb-link which points to another bean in the same ejb-jar.

----- Original Message -----
From: Guy Rouillier
To: [EMAIL PROTECTED]
Sent: Tuesday, May 01, 2001 8:55 AM
Subject: Re: [JBoss-user] It never finds beans in another *.jar's


I'm going to be doing this in the near future, so I took a look at the docs.  It said 
to use a jndi-name like this:

<jndi-name>t3://otherserver/application/beanB</jndi-name>

If I understand this correctly, the JNDI name is the name we use in the ctx.lookup() 
call.  With the above, a lookup for an external
EJB on the same JBoss is different from a lookup for the same EJB on a different 
JBoss.  Wouldn't that require a source code change?
That would not be good.
----- Original Message -----
From: Vinay Menon
To: JBOSS
Sent: Sunday, April 29, 2001 11:47 AM
Subject: Re: [JBoss-user] It never finds beans in another *.jar's


Hi,
     Check out the section 'External EJB Reference' in chapter 6 in the online 
documentation for jboss at
www.jboss.org\documentation\HTML\ch06s05.html

Vinay


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

Reply via email to