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

MXBean logic to convert proxy to ObjectName is incorrect

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P3 P3
    • 6
    • 6
    • core-svc
    • None
    • b47
    • generic
    • generic

      In an MXBean interface X, the parameter to a setter or operation can have a type that is also an MXBean interface Y. The mapped type of this parameter will then be ObjectName. When a proxy is constructed for X, calling the setter or operation method means converting an object of type Y into an ObjectName. The object of type Y must be an MXBean proxy. The current code wrongly assumes (in ProxyMXBeanLookup.mxbeanToObjectName) that any such proxy must be the result of a previous ObjectName->proxy conversion because it was the return value of an MXBean method that returned Y.

      This is causing occasional test failures in javax/management/mxbean/MXBeanTest that look like this:
      FAILED WITH EXCEPTION: opGraph
      java.lang.reflect.InvocationTargetException
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:585)
      at MXBeanTest.testInterface(MXBeanTest.java:313)
      at MXBeanTest.testInterface(MXBeanTest.java:187)
      at MXBeanTest.main(MXBeanTest.java:49)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:585)
      at com.sun.javatest.regtest.MainWrapper$MainThread.run(MainWrapper.java:83)
      at java.lang.Thread.run(Thread.java:608)
      Caused by: java.lang.reflect.UndeclaredThrowableException
      at $Proxy0.opGraph(Unknown Source)
      ... 13 more
      Caused by: javax.management.openmbean.OpenDataException: No name for object: test:type=GraphMXBean-javax.management.remote.rmi.RMIConnector$RemoteMBeanServerConnection@1264eab
      at com.sun.jmx.mbeanserver.OpenConverter$MXBeanConverter.toOpenValue(OpenConverter.java:625)
      at com.sun.jmx.mbeanserver.ConvertingMethod.toOpenParameters(ConvertingMethod.java:126)
      at com.sun.jmx.mbeanserver.MXBeanInvocationHandler.invoke(MXBeanInvocationHandler.java:190)
      at javax.management.MBeanServerInvocationHandler.invoke(MBeanServerInvocationHandler.java:274)
      ... 14 more

      They are apparently occasional because they depend on whether a WeakHashMap has been cleaned up by a garbage collection or not.
      ###@###.### 2005-07-13 17:55:04 GMT

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

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: