Hi there, I am having some confusion about ejb-link. 1) If an EJB refers to another EJB which is defined in the same/different ejb-jar file of the SAME J2EE app., the deployer must use ejb-link to refer to the target EJB. 2) What if an EJB wants to refer to another EJB in a different J2EE app. or even in a different container? It can do that by using JNDI to find the home interface for that remote EJB, right? Now, the programming interface for both 1) and 2) see identical, both use JNDI and narrow to the home interface of another EJB, what is the difference and why is ejb-link necessary in 1) but not 2)? Does ejb-link give the container some indication for performance gain since the container knows to look for the target EJB in the same J2EE application? Thanks. Yan
posted 12 years ago
I think the key thing is having the client stubs in the client EJB's classpath. If both EJBs reside within the same .ear, the client EJB can obtain the stub classes via the .ear classloader.