-
Use EJB3 from simple class (1 messages)
- Posted by: Alucard Hellsing
- Posted on: July 26 2008 17:34 EDT
Hello, I'm trying to use a stateless bean from a simple class. When I use following in a servlet class (descending from HttpServlet), @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?Threaded Messages (1)
- Re: Use EJB3 from simple class by Alucard Hellsing on July 26 2008 18:05 EDT
-
Re: Use EJB3 from simple class[ Go to top ]
- Posted by: Alucard Hellsing
- Posted on: July 26 2008 18:05 EDT
- in response to Alucard Hellsing
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