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

Wrong exception thrown for setAttribute on a Standard MBean with value of wrong type

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P2 P2
    • 6
    • 6
    • core-svc
    • b53
    • 6
    • b55
    • generic
    • generic

      When setting an attribute of a Standard MBean via MBeanServer.setAttribute, if the value given is not of the correct type, the result was previously an InvalidAttributeValueException. As of b53, it is a RuntimeMBeanException wrapping an IllegalArgumentException in the guts of the reflection code:

      javax.management.RuntimeMBeanException
              at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.rethrow(DefaultMBeanServerInterceptor.java:837)
              at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.rethrowMaybeMBeanException(DefaultMBeanServerInterceptor.java:850)
              at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.setAttribute(DefaultMBeanServerInterceptor.java:749)
              at com.sun.jmx.mbeanserver.JmxMBeanServer.setAttribute(JmxMBeanServer.java:696)
              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 Tree$Call.value(Tree.java:571)
              at Interpreter.interpret(Interpreter.java:92)
              at Interpreter.main(Interpreter.java:45)
      Caused by: java.lang.IllegalArgumentException: argument type mismatch
              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.jmx.mbeanserver.StandardMBeanIntrospector.invokeM2(StandardMBeanIntrospector.java:95)
              at com.sun.jmx.mbeanserver.StandardMBeanIntrospector.invokeM2(StandardMBeanIntrospector.java:29)
              at com.sun.jmx.mbeanserver.MBeanIntrospector.invokeM(MBeanIntrospector.java:193)
              at com.sun.jmx.mbeanserver.PerInterface.setAttribute(PerInterface.java:84)
              at com.sun.jmx.mbeanserver.MBeanSupport.setAttribute(MBeanSupport.java:240)
              at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.setAttribute(DefaultMBeanServerInterceptor.java:743)
              ... 8 more

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

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: