* Forwarded by Sozonnik Andrew
* From: "Christian Riege"
* Date: Wed, 4 Jun 2003 09:26:25 +0200
* To: "Sozonnik Andrew"
* Subj: Re: Jboss question
On Tue, Jun 03, 2003 at 03:12:57PM +0300, Sozonnik Andrew wrote:
>> I have two EAR files, and I want to make local reference from EJB in
>> 1st EAR to EJB in 2nd EAR.
according to the EJB specs there is no way to make a local reference
between to EJBs contained in different .ear files. The only way to link
them is by using a remote (by means of <ejb-ref> in the DD)
Local scoping only works when the EJBs are packaged in the same .ear file
-- they may be in different .jar files in that .ear but they
MUST be in the same .ear.
>> The questions are:
>> 1. Is all written above correct, and there is no another ways to make
>> local reference?
see above. your approach of using <ejb-link> with a relative path sort of
"works" but this is a) against the specs strictly speaking and
b) not really supported -- i didn't even know that this works before you
mentioned it in your mail :).
>> 2. If it is really so, maybe org.jboss.ejb.EjbUtil can be modified to
>> combine resolveAbsoluteLink and resolveRelativeLink to specify path
>> to EAR file and EJB name to search, or make global search through all
>> EJB"s ?
i don't think that this is a feasible approach to the problem.
when you are deploying on JBoss, inter-EJB calls are optimized anyways,
even if the EJBs are deployed in two different .ear files; even if you
are "only" using remote interfaces.
what you want would be a JBoss-specific 'enhancement' to the official
spec and would basically make your .ear's undeployable on other vendors
app-servers. stick with regular remote interfaces; this will make your
application a) portable and b) as JBoss optimized the calls anyways (as
long as the EJBs are running in the same VM), you won't get the usual
penalty of using the remote interface to access the other EJB.
hope this helps and best regards,