My env is Netbean with Glassfish. I am able to create a servlet to call EJB with this code:
public class TryAdvise_create extends HttpServlet {
@EJB
AdviseFacadeRemote advBean;
......
protected void processRequest(HttpServletRequest request, ........ {
......
Advise adv = new Advise(123, "123 Company");
advBean.create(adv);
It works great. But when doing the same on a Struts Action:
public class TryAdviseAction extends Action {
@EJB
AdviseFacadeRemote advBean;
......
public ActionForward execute(ActionMapping mapping, ......... {
Advise a = advBean.find(new Long(1));
advBean is always null. Why? Please help.
[Message sent by forum member 'senderj' (senderj)]
http://forums.java.net/jive/thread.jspa?messageID=335811