users@glassfish.java.net

Re: lookup other EJB from one EJB within same EAR

From: <glassfish_at_javadesktop.org>
Date: Fri, 05 Sep 2008 10:32:25 PDT

If the dependency is on a remote business interface, you use ejb-ref, but you'll also need the
<remote> element that lists the fully-qualified name of the business interface.

If the dependency is on a local business interface, use an ejb-local-ref and add the <local> element listing the local business interface.

You can also use the @EJB annotation at the *bean-class* level to avoid having to define the .xml. That would look like this :
@EJB(name="MySFSB2", beanInterface=<interface>.class, beanName="SFSB2")
@Stateful
public class .... { }

There's more info on this in our EJB FAQ :

https://glassfish.dev.java.net/javaee5/ejb/EJB_FAQ.html#EJB_ejb-ref_ejb_local_ref
[Message sent by forum member 'ksak' (ksak)]

http://forums.java.net/jive/thread.jspa?messageID=297494