Closed alechenninger closed 6 years ago
@cyrille-leclerc @kerlandsson Any thoughts on this? Thank you!
Thanks for your proposal @alechenninger, it's great to see RedHat employees helping us.
Your idea is to have another "wait" strategy which would be to wait for "one" mbean server to be created with a timeout security, correct? I have no doubt that you know better than us how we should integrate with JBoss AS.
Could you please update the documentation on README.md? Maybe introducing a section called "Delayed Startup for JBoss AS / Wildfly (version >=1.2.8)" and refactoring the documentation section "Delayed startup (version >= 1.2.1)" removing from it the references to JBoss AS and Wildfly as your solution works better.
Thanks for taking a look @cyrille-leclerc ! Full transparency: while I work at Red Hat, I don't work on JBoss. That said, I do have a lot of experience with it :-).
I updated the pull request. It looks like the root cause of these problems is this in the jboss-modules code:
final String mbeanServerBuilderName = getServiceName(bootClassLoader, "javax.management.MBeanServerBuilder");
if (mbeanServerBuilderName != null) {
System.setProperty("javax.management.builder.initial", mbeanServerBuilderName);
ManagementFactory.getPlatformMBeanServer();
If anything initializes the PlatformMBeanServer before jboss-modules has a chance to set "javax.management.builder.initial", then the PlatformMBeanServer JBoss expects to be used, won't be. JBoss uses a PluggableMBeanServerBuilder that adds some additional functionality.
I'll try and add a test for good measure. Thanks!
Looks like there aren't any tests for JmxTransAgent class yet... not sure if I have time to be the first :-). Let me know what you think! If this could be released, we can stop using my fork :-). Thanks!
This should be a little more stable and faster than a flat delay.
Let me know what you think and I can try and add a test for it.
Tested with EAP7: