users@glassfish.java.net

Re: _at_EJB in further classes

From: Sahoo <Sahoo_at_Sun.COM>
Date: Fri, 21 Dec 2007 17:26:36 +0530

Pawel R. wrote:
> -----Original Message-----
> From: Sanjeeb.Sahoo_at_Sun.COM [mailto:Sanjeeb.Sahoo_at_Sun.COM] On Behalf Of
> Sahoo
> Sent: Friday, December 21, 2007 7:01 AM
> To: users_at_glassfish.dev.java.net
> Subject: Re: @EJB in further classes
>
> Injection is allowed in managed classes (e.g. Servlets, filters,
> listeners, etc.). If Servant is just an ordinary class in your war file,
> then @EJB is ignored resulting in NPE. This requirement is specified in
> the Java EE platform spec.
>
> Thanks,
>
> what is the best way to make an ordinary helper class managed?
>

Can you turn the class into an event listener or filter? If not, then
you can't use injection there. Do JNDI lookup instead.

Thanks,
Sahoo