I have an application in an ear file that contains 2 modules. One is a web component war and the other is an ejb jar.
appname.ear
+-webclient.war
+-webbean.jar
I have declared my bean with a @Stateless annotation:
@Stateless
public class EchoBean {}
And added a dependency with @EJB in a servlet in my web module:
@EJB(lookup="java:app/webbean/EchoBean")
private EchoBean _echo;
Everything compiles but when I run, this object always comes up null. Using a JNDI lookup on the InitialContext I can successfully get the bean via "java:app/webbean/EchoBean". But using that as the lookup attribute in the @EJB also fails. What could I be doing wrong?