INContainer lookups reference the EJB and the sessionContext references the defined @Resource from descriptor
e.g.
@EJB(name="ejb/ejbName" beanInterface=ejbClass.class)
@Stateless
public class ManagerBean implements Manager (
@Resource SessionContext sessionContext; //any name has to be defined in Resource
ejbClass ejb=(ejbClass)sessionContext.lookup("ejb/ejbClass");
ejb.method..
OutofCountainer uses the full ENC e.g.
ejbClass ejb=(ejbClass)new InitialContext().lookup("java:/comp/env/ejb/ejbClass");
ejb.method..
makes sense?
Martin Gainty
______________________________________________
Verzicht und Vertraulichkeitanmerkung/Note de déni et de confidentialité
Diese Nachricht ist vertraulich. Sollten Sie nicht der vorgesehene Empfaenger sein, so bitten wir hoeflich um eine Mitteilung. Jede unbefugte Weiterleitung oder Fertigung einer Kopie ist unzulaessig. Diese Nachricht dient lediglich dem Austausch von Informationen und entfaltet keine rechtliche Bindungswirkung. Aufgrund der leichten Manipulierbarkeit von E-Mails koennen wir keine Haftung fuer den Inhalt uebernehmen.
Ce message est confidentiel et peut être privilégié. Si vous n'êtes pas le destinataire prévu, nous te demandons avec bonté que pour satisfaire informez l'expéditeur. N'importe quelle diffusion non autorisée ou la copie de ceci est interdite. Ce message sert à l'information seulement et n'aura pas n'importe quel effet légalement obligatoire. Étant donné que les email peuvent facilement être sujets à la manipulation, nous ne pouvons accepter aucune responsabilité pour le contenu fourni.
> Date: Fri, 21 May 2010 12:09:21 -0700
> From: glassfish_at_javadesktop.org
> To: users_at_glassfish.dev.java.net
> Subject: appclient script ejb search
>
> Hi,
>
> i'm a bit confused by the following behaviour of appclient on GF 2:
> - i'm passing as its "file" paramater an EAR containing the app client module to run and, for what ever reason, containing also an ejb jar.
> The app client module has an @EJB reference to a deployed EJB in another EAR.
>
> But the ejb jar contains at its turn an EJB implementing the same remote interface as the one the appclient module targets.
>
> Strangely it is the "neighbour" EJB that gets called as if a "by interface" intra-ear lookup is done who, as we all know, takes precedence to the "by jndi name" lookup.
>
> I expected the lookup to find by jndi name, the remote EJB in the other ear. As the ACC is not considering ejb jars and is not deploying EJBs on tiself.
> [Message sent by forum member 'vladbalan']
>
> http://forums.java.net/jive/thread.jspa?messageID=470931
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe_at_glassfish.dev.java.net
> For additional commands, e-mail: users-help_at_glassfish.dev.java.net
>
_________________________________________________________________
The New Busy is not the old busy. Search, chat and e-mail from your inbox.
http://www.windowslive.com/campaign/thenewbusy?ocid=PID28326::T:WLMTAGL:ON:WL:en-US:WM_HMP:042010_3