The MBean is used by a piece of code in the following way: Object securityService = (Object) ctx.lookup("Security/STEPSSecurityService"); return (STEPSSecurityService) securityService;
I do not get any problem when my application is loaded by the default classloader and I am able to get the handle to the Service. But when the same code is loaded by a classloader for an .ear file (I have a jboss-app.xml with loader repository entry), the code does not work and I always get a ClassCastException at the return statement above. I think the MBean is not visible to the classes in this ear. If yes, how do I get access to this Mbean ?