I'm having trouble obtaining a reference to an EJB entity bean in a portlet.
The entity bean has successfully deployed and I've confirmed the JNDI name in the jmx-console (PersonBean).
I had first tried to obtain the reference through the EJB annotation, injecting it into the portlet as such:
public class ModifyPerson extends GenericPortlet { @EJB(name="PersonBean") private PersonLocal bean; . . . }
public void inti() throws PortletException{ try{ InitialContext ctx = new InitialContext(); bean = (PersonLocal) ctx.lookup("java:/env/comp/PersonBean"); }catch(NamingException ex){ throw new PortletException(ex.getMessage()); } }