When using
EJB (3.1), container should manage amongst others the JMS resources. Bean developer either configures @Resource annotations to the bean, or resource-refs into ejb-jar.xml.
questions:
1. What if the @Resource annotations are not in the EJB itself, but in some utility class, injected into EJB using CDI (or even deeper in injection path EJB <- util1 <- ... <- util n)? For example my EJB:
does this work, and is it standard and portable? (it does work on Glassfish v3) Is this defined in the specs somewhere?
2. What's the behavior if bean developer does not use @Resource-annotations or resource-refs, and instead tries to access JMS straight from code (tries to look up connectionFactory directly from JNDI, for example)? What does specification say (is result "undefined"), and if its undefined, what happens in practise?