]
Kabir Khan updated AS7-1443:
----------------------------
Assignee: (was: Kabir Khan)
TcclMBeanServer uses wrong classloader
--------------------------------------
Key: AS7-1443
URL:
https://issues.jboss.org/browse/AS7-1443
Project: Application Server 7
Issue Type: Bug
Components: JMX
Affects Versions: 7.0.0.Final
Reporter: Adrian Brock
There is an MBeanServer implementation org.jboss.as.jmx.tcl.TcclMBeanServer that attempts
to implement the classloader switching for MBeans found in jboss6 and before.
However it uses the wrong classloader.
It uses "PlatformMBeanServer".getClassLoaderFor(ObjectName) of the mbean as the
classloader.
This is not the classloader passed to createBean(), i.e. the deployment's
classloader, it is the classloader where the MBean was loaded from, they are not
necessarily the same.
This means classes in the deployment will not be visible for invocations on the mbean
unless the place where the mbean class is defined is either the same classloader (this
will be true in most cases) or it happens to import the deployment's classloader (very
unlikely).
There is a related issue in that because getClassLoaderFor() is no longer correct,
deserialisation of requests using the jmx remote connector won't work for classes
passed over the wire that are in the deployment.
Finally, because TcclMBeanServer is not built using an MBeanServerBuilder, it can't
be the platform MBeanServer, which means tools like jconsole wont use it and the
classloader will be wrong for those requests.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: