In the code below, userManagerLocal is the local interface of an EJB. The exact same injection puts the right EJB in a servlet in the same project, but not in the JAX-RS code below. In JAX-RS, it is injected as null.

I know this is older post but I am facing the same issue. I have tried both solutions (adding beans.xml file and setting the @Stateless annotations to rest class) but unfortunatelly none of them worked.

Also tried to change the @EJB to @Inject but I keep getting null reference! Have anyone found a solution to this? am I doing something wrong?