This content has been marked as final.
Show 2 replies
-
1. Re: Using EJB injection in JMX / MBean
salewski Aug 21, 2007 11:03 AM (in response to vri_97)The @EJB annotations are part of the EJB 3.0 spec, which is separate from the JMX spec. The @EJB annotation is for use by EJBs, the resource being injected by the EJB container. MBeans have to look up resources in JNDI "manually".
However, if you're not allergic to vendor extensions, you may be interested in the JBoss @Service EJB extension:
http://docs.jboss.com/ejb3/app-server/reference/build/reference/en/html/jboss_extensions.html -
2. Re: Using EJB injection in JMX / MBean
vri_97 Aug 21, 2007 9:19 PM (in response to vri_97)Thank you for the explanation.
After some thinking, I guess is it's because MBean was created before the EJBs. And by right, the EJB at the time of MBean creation is not available yet, so it can not be injected.
Though I put dependency on EJBs, it only delay to call the start() method, rather than the create().