Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-4984057

Cannot monitor more than 16 MBeans from a single Monitor

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: P3
    • Resolution: Fixed
    • Affects Version/s: 5.0
    • Fix Version/s: 5.0
    • Component/s: core-svc
    • Labels:
    • Subcomponent:
    • Resolved In Build:
      b40
    • CPU:
      generic
    • OS:
      generic

      Description

      Calling Monitor.addObservedObject more than 16 times for a given Monitor (CounterMonitor, GaugeMonitor, or StringMonitor) produces an exception:

      javax.management.RuntimeMBeanException: RuntimeException thrown in operation addObservedObject
      at com.sun.jmx.mbeanserver.StandardMetaDataImpl.invoke(StandardMetaDataImpl.java:424)
      at com.sun.jmx.mbeanserver.MetaDataImpl.invoke(MetaDataImpl.java:228)
      at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke(DefaultMBeanServerInterceptor.java:823)
      at com.sun.jmx.mbeanserver.JmxMBeanServer.invoke(JmxMBeanServer.java:792)
      at javax.management.MBeanServerInvocationHandler.invoke(MBeanServerInvocationHandler.java:209)
      at $Proxy0.addObservedObject(Unknown Source)
      at MultiMonitorTest.main(MultiMonitorTest.java:59)
      Caused by: java.lang.ArrayIndexOutOfBoundsException
      at java.lang.System.arraycopy(Native Method)
      at javax.management.monitor.Monitor.insertintElementAt(Monitor.java:596) at javax.management.monitor.Monitor.addObservedObject(Monitor.java:363)
      at sun.reflect.GeneratedMethodAccessor1.invoke(Unknown Source)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:324)
      at com.sun.jmx.mbeanserver.StandardMetaDataImpl.invoke(StandardMetaDataImpl.java:410)
      ... 6 more

      The problem is that the methods insertintElementAt and ensureintCapacity assume that they can resize an array that is passed as a parameter. ensureintCapacity incorrectly assigns the newly-reallocated bigger array to its array parameter, which of course has no durable effect.

        Attachments

          Activity

            People

            Assignee:
            emcmanus Eamonn McManus
            Reporter:
            emcmanus Eamonn McManus
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: