Could you use an environment entry?
<env-entry>
<env-entry-name>ReallyRemoteBean</env-entry-name>
<env-entry-type>java.lang.String</env-entry-type>
<env-entry-value>t3://otherserver/application/beanB</env-entry-value>
</env-entry>
// this could be done one time and cached
// I'm not certain if you need the java:comp/ prefix here
String jndiName := (String)ctx.lookup("java:comp/env/ReallyRemoteBean");
BHome home = (BHome)ctx.lookup(jndiName);
B bean = home.create(pk);
You're doing two lookups but at least you don't have to change code. The
environment entry name is hard coded instead. This is an alternative to
Vinay's acceptable solution. The advantage here is the jndi name isn't in a
separate properties file that must also be edited, deployed, & managed. It's
in the DD where Bean B is hosted and the DD (in two or more elements) for
each client of Bean B.
My $1/50.
Steve
----- Original Message -----
From: Vinay Menon
To: JBOSS
Sent: Tuesday, May 01, 2001 4:02 pm
Subject: Re: [JBoss-user] It never finds beans in another *.jar's
Have had quite a few chaps usually put the jndi names in something as simple
as a resource bundle/properties file. Then it wouldn't need a recompile of
code.... an option you might want to try? However, I must add that it is
recommended by folks at jboss that ejbs that are referenced by one another
be bundled together in a single jar.......
Your views?
Vinay
----- Original Message -----
From: Guy Rouillier
Sent: Tuesday, May 01, 2001 8:07 PM
To: [EMAIL PROTECTED]
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