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

REGRESSION: Wrong exception thrown for unsupported UsageThreshold attribute on MemoryPoolMXBean

    XMLWordPrintable

Details

    • b55
    • 6
    • b57
    • generic
    • generic

    Description

      This regression has been introduced in b55.

      Unit test java/lang/management/ManagementFactory/MXBeanException.java fails.

      Calling

        MBeanServer mbs = ManagementFactory.getPlatformMBeanServer();
        ObjectName on =
          new ObjectName(ManagementFactory.MEMORY_POOL_MXBEAN_DOMAIN_TYPE +
                         ",name=PS Survivor Space");
        Attribute att = new Attribute("UsageThreshold", 1000);
        mbs.setAttribute(on, att);

      used to throw javax.management.RuntimeMBeanException with a
      java.lang.UnsupportedOperationException as invocation target:

      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 MXBeanException.main(MXBeanException.java:98)
      Caused by: java.lang.UnsupportedOperationException: Usage threshold is not supported
      at sun.management.MemoryPoolImpl.setUsageThreshold(MemoryPoolImpl.java:95)
      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:589)
      at com.sun.jmx.mbeanserver.ConvertingMethod.invokeWithOpenReturn(ConvertingMethod.java:153)
      at com.sun.jmx.mbeanserver.MXBeanIntrospector.invokeM2(MXBeanIntrospector.java:99)
      at com.sun.jmx.mbeanserver.MXBeanIntrospector.invokeM2(MXBeanIntrospector.java:36)
      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)
      ... 2 more

      After fixing the bug 6324523 a regression has been introduced and
      now the same call throws javax.management.InvalidAttributeValueException:

      javax.management.InvalidAttributeValueException: Invalid value for attribute UsageThreshold: 1000
      at com.sun.jmx.mbeanserver.MBeanIntrospector.maybeInvalidParameter(MBeanIntrospector.java:246)
      at com.sun.jmx.mbeanserver.MBeanIntrospector.invokeSetter(MBeanIntrospector.java:236)
      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)
      at com.sun.jmx.mbeanserver.JmxMBeanServer.setAttribute(JmxMBeanServer.java:696)
      at MXBeanException.main(MXBeanException.java:98)

      Attachments

        Issue Links

          Activity

            People

              lmalvent Luis-Miguel Alventosa (Inactive)
              lmalvent Luis-Miguel Alventosa (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:
                Imported:
                Indexed: