Ken, It is valid to access a local interface across a jar boundary as long as the accessor ( JSP, another EJB, Servlet) and the Bean with the Local interfaces are co-located in the same VM. EJB 2.0 spec has introduced another tag ejb-local-ref element whihc is used for the declaration of a reference to an enterprise bean's local home. I do not think that the right way to ensure this is by keeping them in the same jar. This is evident from the very fact that now the JSP and servlets can also lookuo local beans using the same ejb-local-ref tags. The responsibility of ensuring that the local is accessible lie both with the Bean Provider and the Container. In case the Bean provider uses the ejb-link eleement then the Bean provider should ensure that the link is a valid one. <spec> "The ejb-link element is used in the ejb-ref and ejb-local-ref elements to specify that an EJB reference is linked to an enterprise bean. The value of the ejb-link element must be the ejb-name of an enterprise bean in the same ejb-jar file or in another ejb-jar file in the same J2EE application unit. Alternatively, the name in the ejb-link element may be composed of a path name specifying the ejb-jar containing the referenced enterprise bean with the ejb-name of the target bean appended and separated from the path name by "#". The path name is relative to the jar file con-taining the enterprise bean that is referencing the enterprise bean. This allows multiple enterprise beans with the same ejb-name to be uniquely identified. <spec>
In case the Bean Developer does not use the ejb-link element then the container should ensure that the resolution of the ejb-local-ref at the time of deployment is a valid one. Hope this helps Amit Khanna. ----- Original Message ----- From: "Ken Delong" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Wednesday, March 27, 2002 12:12 AM Subject: Local Interfaces visible across JAR boundaries? > Is it valid to access a local interface across a JAR boundary? > > I realize that the local bean and client must be co-located in the same JVM. > I think the only way to *ensure* this is to keep them in the same JAR, as > the ejb-jar file is a "non-decomposable" unit of deployment, and will be > guaranteed to be in the same container (hence, the same JVM). > > I believe this is why relationships are restricted to within an EJB Jar - > they must use local interfaces, and allowing them to cross JAR boundaries > might lead to trouble. > > OTOH, the spec allows the <ejb-link> tag to reference beans in other > ejb-jars, and it doesn't say "only do this with remote targets". > > Anyone know the answer (and *please* don't respond with "It works in <Brand > X Server><Version x.xx>")? > ------------------- > Kenneth DeLong > Senior Consultant > Direct: 510-517-5839 > Fax: 972.789.1340 > > Valtech Technologies, Inc. > 5080 Spectrum Drive > Suite 1010 West > Addison, Texas 75001 > www.valtech.com <http://www.valtech.com> > > transforming technology skills > into sustainable business value > > =========================================================================== > To unsubscribe, send email to [EMAIL PROTECTED] and include in the body > of the message "signoff EJB-INTEREST". For general help, send email to > [EMAIL PROTECTED] and include in the body of the message "help". > =========================================================================== To unsubscribe, send email to [EMAIL PROTECTED] and include in the body of the message "signoff EJB-INTEREST". For general help, send email to [EMAIL PROTECTED] and include in the body of the message "help".
