Status: New
Owner: ----
Labels: Type-Defect Priority-Medium Component-SLEE SubComponent-SLEE-Core
SLEE-2.8.0.FINAL
New issue 3236 by [email protected]: SLEE:JBoss AS 5.1.0.GA JMX Console
fails to open SLEE Profile MBean
http://code.google.com/p/mobicents/issues/detail?id=3236
Version tested:2.6.0
Bug Description:When accessing a SLEE Profile MBean via JMX Console, the
dependant Java class cannot be loaded by the classloader.
Precondition: the SLEE Profile's CMP interface depends on a custom Java
class which is defined in a separate SLEE library (TriggerCondition.java):
public interface SipConfigurationProfileCMP {
// 'triggerConditions' CMP field setter
public abstract void setTriggerConditions(TriggerCondition[] value);
// 'triggerConditions' CMP field getter
public abstract TriggerCondition[] getTriggerConditions();
}
Additional info: This issue looks as if essentially the same as the one
described here:
https://community.jboss.org/message/616328
The solution suggested by JBoss team members involves changing the MBean
registration code so that it passes the correct classloader to the
MBeanServer.
In this case the MBean registration is done in
org.mobicents.slee.container.security.Utility, method:
_registerSafelyMBean(final SleeContainer sleeContainer, final ObjectName
on, final Object bean)
The proposed solution in this case is not invoking the plain vanilla
registration (sleeContainer.getMBeanServer().registerMBean(bean, on);), but
passing the bean classloader, I tried (successfully) this:
Map<String, Object> values = new HashMap<String, Object>();
ClassLoader classLoader = bean.getClass().getClassLoader();
values.put(ServerConstants.CLASSLOADER, classLoader);
sleeContainer.getMBeanServer().invoke(
ObjectNameFactory.create(ServerConstants.MBEAN_REGISTRY),
"registerMBean",
new Object[] { bean, on, values },
new String[] { Object.class.getName(),
ObjectName.class.getName(), Map.class.getName() }
);
Attachments:
stacktrace.txt 9.0 KB