The MBeans are not part of Java EE standard. So, @Resource style resource injection does not work for them. Sorry. We need that to work soon, but till that happens, you need to carry the non-portable code around.
One way to make it less painful is to actually:
- Use the Java SE default management factory and MBeanServer and only look up local MBeans.
- Or if you are using GlassFish v3, you can inject the MBeanServer using the standard @Resource resource injection. But this too is GlassFish v3 specific.
Can you file an RFE against GlassFish (and Java EE) to make this standard?
-Kedar
[Message sent by forum member 'km' (kedar.mhaswade_at_sun.com)]
http://forums.java.net/jive/thread.jspa?messageID=381819