Hello,

Platform : Struts 2, EJB 3.0, Glassfish 2.1

I wish to obtain a reference to an EJB using injection.

This works fine within a servlet, but from within a Struts2 action class, all references to injected EJB variables hold a 'null' reference.

I've included a portion of my action class below.

I'm confused as to why a Servlet has no trouble using injection as compared to the Struts 2 action class. Both the servlet and action class reside in the same Web application.

Does anybody have any ideas?

/public class UserAction extends ActionSupport implements ServletRequestAware, SessionAware {

   private static Logger logger = Logger.getLogger(SetupServlet.class);
@EJB
   SetupServiceBeanLocal setupService;
@EJB UserServiceBeanLocal userService;
...
}/

Reply via email to