On Wed, 14 Feb 2001, you wrote:
> Hi,
> 
> I don't understand the following:
> If EJB X in package A has to access EJB Y in package B, why do I have to 
> include Y's interfaces (and probably PK-class) in A?
> 
> Shouldn't X find Y without the include in A when A and B are deployed in 
> the same container?

No.

The classes are loaded with different classloaders so that you can re-deploy
one bean without re-deploying the other.  A class which is loaded in one
classloader is not visible in another class-loader, unless the first is an
ancestor of the second.  I guess you *could* get each classloader to look in
all the other EJBs to see if the class is there, but that would quickly end up
in a horrible mess and would problably hit performance too.  So you have to
include the interfaces (yes, and the PK class, so findByPrimaryKey will work)
in both beans.

Of course, you could use dynamic classloading.  If you could get it to work,
that is.

Tom


--
--------------------------------------------------------------
To subscribe:        [EMAIL PROTECTED]
To unsubscribe:      [EMAIL PROTECTED]
List Help?:          [EMAIL PROTECTED]

Reply via email to