Details
-
Bug
-
Resolution: Done
-
Major
-
None
-
None
Description
Intermittent testsuite failures, e.g.
Log shows this repeatedly:
[0m[33m18:38:11,612 WARN [org.jboss.remotingjmx.protocol.v2.ServerCommon] (pool-2-thread-12) Unexpected internal error: java.lang.NullPointerException
at org.jboss.as.jmx.model.RootResourceIterator.doIterate(RootResourceIterator.java:49)
at org.jboss.as.jmx.model.RootResourceIterator.doIterate(RootResourceIterator.java:55)
at org.jboss.as.jmx.model.RootResourceIterator.doIterate(RootResourceIterator.java:55)
at org.jboss.as.jmx.model.RootResourceIterator.iterate(RootResourceIterator.java:39)
at org.jboss.as.jmx.model.ModelControllerMBeanHelper.getMBeanCount(ModelControllerMBeanHelper.java:103)
at org.jboss.as.jmx.model.ModelControllerMBeanServerPlugin.getMBeanCount(ModelControllerMBeanServerPlugin.java:116)
at org.jboss.as.jmx.PluggableMBeanServerImpl.getMBeanCount(PluggableMBeanServerImpl.java:220)
at org.jboss.remotingjmx.protocol.v2.ServerProxy$GetMBeanCountHandler.handle(ServerProxy.java:618)
at org.jboss.remotingjmx.protocol.v2.ServerCommon$MessageReciever$1.run(ServerCommon.java:152)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) [rt.jar:1.7.0_13]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) [rt.jar:1.7.0_13]
at java.lang.Thread.run(Thread.java:722) [rt.jar:1.7.0_13]
RootResourceIterator.doIterate is reading the resource twice:
for (ResourceEntry entry : current.getChildren(type)) { final PathElement pathElement = entry.getPathElement(); final Resource child = current.getChild(pathElement); // why this call since "entry" and "child" should be the same object final PathAddress childAddress = address.append(pathElement); doIterate(child, childAddress); }
The problem is "child" is null, which is possible with a dynamic resource. So, either "entry" should be used, or, if there is some reason for the 2nd read, a check for null is needed before the recursive doIterate call.