Alucard
stranger
Reged: 07/16/08
Posts: 6
|
|
Hello,
I'm trying to use a stateless bean from a simple class. When I use following in a servlet class (descending from HttpServlet),
Quote:
@EJB public GatewaySessionLocal bean;
bean variable is filled in and everything's cool.
But when I do the same in a class, descending directly from Object, bean variable stays null.
Are there any specific conditions to be met by a class which tries to access bean in such a way?
|
Alucard
stranger
Reged: 07/16/08
Posts: 6
|
|
Got the answer! 
EJB objects in POJO classes can only be acquired using InitialContext (At least in Glassfish, which I use).
Excellent resource: https://glassfish.dev.java.net/javaee5/ejb/EJB_FAQ.html#POJOLocalEJB
|