I have a simple web application, packed as an EAR, deployed on Glassfish. The EAR has a web module and an EJB module. The web module has a faces page, and a ManagedBean. The Faces page only has a button on it, and the button is tied to a method in the ManagedBean, and clicking the button does indeed fire the method.
The managed bean:
public class Bar {
public Bar() {
}
@EJB StudentProfileFacade f;
public void hello(ActionEvent evt) {
System.out.println("*** f: " + f);
}
}
The EJB is not getting injected, the error I get is:
Exception attempting to inject Unresolved Ejb-Ref com.web.Bar/f@jndi: com.StudentProfileFacade@[email protected]@Session@null into class com.web.Bar
What do I need to do so that the web module will find the EJB module, and the EJBs in it?