Is it possible to inject the EntityManager into a stateless session bean if the bean is invoked from a MDB?
I have a message driven been that calls a stateless session bean. In the session bean I inject entity manager. But when the session bean is invoked from the MDB the entity manager is always null. The app is deployed as an EAR and everything deployes successfully.
MDB:
@MessageDriven(activationConfig = { @ActivationConfigProperty(propertyName="destinationType", propertyValue="javax.jms.Queue"), @ActivationConfigProperty(propertyName="destination", propertyValue="queue/KeyCheckImageQueue2") }) public class KeyCheckImagesMessageHandler implements MessageListener{ public void onMessage (Message msg) {
@Stateless @Name("xyzServices") public class KeyServicesImpl implements KeyServices { @PersistenceContext private EntityManager em;
This should be fine. How are you injecting the SLSB into the MDB? What version of Seam/AS?