geronimo-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Forrest Xia <>
Subject Re: Using @EJB annotation instead of looking up for EJB
Date Mon, 25 Jun 2012 05:18:13 GMT
Refer to bank sample, for example,

On Mon, Jun 25, 2012 at 12:55 PM, nemesis_sun <> wrote:

> Hi guys,
> I'm new and on the way of learning Geronimo. I have this simple
> application,
> there is one EJB application and one App Client. In the EJB app, I have one
> remote interface (with "@Remote"), one EJB(with "@Stateless"). In the App
> Client, I have a Main class which accesses the EJB and calls some of its
> functions.
> The problem is, I am able to use InitialContext.lookup() to retrieve an
> instance of the EJB, but not so with the @EJB annotation. It returns a NULL
> value.
> So can someone help me on this issue, how to use @EJB instead of lookup()?
> Please also note that all the annotations I just listed are without any
> element. I know with this alone the server may not have enough info on
> where
> to look for the EJB, so maybe there is some way to specify it, either in
> those annotations or the the deployment plan (my priority is in the
> annotations, if there is any)
> --
> View this message in context:
> Sent from the Users mailing list archive at


Regards, Forrest

View raw message