-
Bug
-
Resolution: Done
-
Major
-
None
-
False
-
None
-
False
-
-
-
-
-
-
?
-
-
-
-
Thread's context classloader while running ServiceMBeanSupport.startService() is org.jboss.as.sar, not "deployment.*.sar". In sar deployments with POJO classes and ejb-jar deployments, the thread context classloader is set to "deployment.<archive-name>", but while in ServiceMBeanSupport it is set to "org.jboss.as.sar".
This is usually not a problem, however, if a custom MBean with ServiceMBeanSupport contains remote JMX call, sar deployment succeeds up to EAP 7.2.9, but fails with the following error from EAP 7.3.0 or later:
16:12:11,980 WARN [org.jboss.example.mbean.support.ConfigService] (MSC service thread 1-4) WFLYSYSJMX0006: Starting failed jboss.support:name=ConfigBean: java.net.MalformedURLException: Unsupported protocol: remote+http at java.management/javax.management.remote.JMXConnectorFactory.newJMXConnector(JMXConnectorFactory.java:366) at java.management/javax.management.remote.JMXConnectorFactory.connect(JMXConnectorFactory.java:269) at deployment.SampleMBean.sar//org.jboss.example.mbean.support.ConfigService.startService(ConfigService.java:22) at org.jboss.as.system-jmx@7.4.13.GA-redhat-00001//org.jboss.system.ServiceMBeanSupport.jbossInternalStart(ServiceMBeanSupport.java:255) ...
This could be a backward compatibility issue between 7.2.9 and 7.3.0, also reproduceed in the latest EAP 7.4.13.
The implementation of sar deployment has been moved from org.jboss.as.jmx to org.jboss.as.sar module by WFCORE-4179 and WFLY-11239 fixed in JBoss EAP 7.3.0. As of JBoss EAP 7.2.9 and earlier, the thread context classloader for ServiceMBeanSupport is org.jboss.as.jmx, not application deployment module. But org.jboss.as.jmx module had a dependency on org.jboss.remoting-jmx. As a consequence, prior to JBoss EAP 7.2.9, remote JMX calls are available from custom MBeans with ServiceMBeanSupport.
jboss-eap-7.2/modules/system/layers/base/.overlays/layer-base-jboss-eap-7.2.9.CP/org/jboss/as/jmx/main/module.xml
<module name="org.jboss.as.jmx" xmlns="urn:jboss:module:1.8"> ... <dependencies> ... <module name="org.jboss.msc"/> <module name="org.jboss.logging"/> <module name="org.jboss.remoting-jmx" services="import" optional="true"/> <<<=== </dependencies> </module>
- is cloned by
-
JBEAP-25942 [GSS](8.0.z) Thread's context classloader for ServiceMBeanSupport startService is not application module
- Closed
- is incorporated by
-
JBEAP-26169 (7.4.z) Upgrade WildFly Core from 15.0.32.Final-redhat-00001 to 15.0.33.Final-redhat-00001
- Closed
- is related to
-
WFCORE-6470 Unexpected classloader when registering MBeans that are part of a deployment
- Resolved
- links to