-
Bug
-
Resolution: Fixed
-
P2
-
6
-
None
-
b53
-
generic
-
generic
The generic MXBean framework must be able to support the existing MXBeans from java.lang.management. But these MXBeans use null values in at least one place: the variou ThreadMXBean.getThreadInfo will return a null ThreadInfo if the input thread id does not exist. If you create an MXBean proxy using JMX.newMXBeanProxy and use it to call getThreadInfo, then a null returned ThreadInfo will get an exception in the proxy-handling code:
Exception in thread "main" java.lang.reflect.UndeclaredThrowableException
at $Proxy0.getThreadInfo(Unknown Source)
at ThreadMXBeanTest.main(ThreadMXBeanTest.java:30)
Caused by: javax.management.MBeanException: interface java.lang.management.ThreadMXBean.getThreadInfo: cannot convert return value to open value: javax.management.openmbean.OpenDataException: Error calling getter for lockInfo: javax.management.openmbean.OpenDataException: Error calling getter for className: java.lang.NullPointerException
at com.sun.jmx.mbeanserver.ConvertingMethod.invokeWithOpenReturn(ConvertingMethod.java:175)
at com.sun.jmx.mbeanserver.MXBeanSupport$MBeanDispatcher.invoke(MXBeanSupport.java:361)
at com.sun.jmx.mbeanserver.MXBeanSupport.invoke(MXBeanSupport.java:239)
at javax.management.StandardMBean.invoke(StandardMBean.java:475)
at com.sun.jmx.mbeanserver.DynamicMetaDataImpl.invoke(DynamicMetaDataImpl.java:200)
at com.sun.jmx.mbeanserver.MetaDataImpl.invoke(MetaDataImpl.java:183)
at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke(DefaultMBeanServerInterceptor.java:865)
at com.sun.jmx.mbeanserver.JmxMBeanServer.invoke(JmxMBeanServer.java:772)
at com.sun.jmx.mbeanserver.MXBeanInvocationHandler$InvokeHandler.invoke(MXBeanInvocationHandler.java:152)
at com.sun.jmx.mbeanserver.MXBeanInvocationHandler.invoke(MXBeanInvocationHandler.java:191)
at javax.management.MBeanServerInvocationHandler.invoke(MBeanServerInvocationHandler.java:311)
... 2 more
Caused by: javax.management.openmbean.OpenDataException: Error calling getter for lockInfo: javax.management.openmbean.OpenDataException: Error calling getter for className: java.lang.NullPointerException
at com.sun.jmx.mbeanserver.OpenConverter.openDataException(OpenConverter.java:1333)
at com.sun.jmx.mbeanserver.OpenConverter$CompositeConverter.toOpenValue(OpenConverter.java:775)
at com.sun.jmx.mbeanserver.OpenConverter$ArrayConverter.toOpenValue(OpenConverter.java:512)
at com.sun.jmx.mbeanserver.ConvertingMethod.invokeWithOpenReturn(ConvertingMethod.java:170)
... 12 more
Caused by: javax.management.openmbean.OpenDataException: Error calling getter for className: java.lang.NullPointerException
at com.sun.jmx.mbeanserver.OpenConverter.openDataException(OpenConverter.java:1333)
at com.sun.jmx.mbeanserver.OpenConverter$CompositeConverter.toOpenValue(OpenConverter.java:775)
at com.sun.jmx.mbeanserver.OpenConverter$CompositeConverter.toOpenValue(OpenConverter.java:773)
... 14 more
Caused by: java.lang.NullPointerException
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.OpenConverter$CompositeConverter.toOpenValue(OpenConverter.java:772)
... 15 more
Exception in thread "main" java.lang.reflect.UndeclaredThrowableException
at $Proxy0.getThreadInfo(Unknown Source)
at ThreadMXBeanTest.main(ThreadMXBeanTest.java:30)
Caused by: javax.management.MBeanException: interface java.lang.management.ThreadMXBean.getThreadInfo: cannot convert return value to open value: javax.management.openmbean.OpenDataException: Error calling getter for lockInfo: javax.management.openmbean.OpenDataException: Error calling getter for className: java.lang.NullPointerException
at com.sun.jmx.mbeanserver.ConvertingMethod.invokeWithOpenReturn(ConvertingMethod.java:175)
at com.sun.jmx.mbeanserver.MXBeanSupport$MBeanDispatcher.invoke(MXBeanSupport.java:361)
at com.sun.jmx.mbeanserver.MXBeanSupport.invoke(MXBeanSupport.java:239)
at javax.management.StandardMBean.invoke(StandardMBean.java:475)
at com.sun.jmx.mbeanserver.DynamicMetaDataImpl.invoke(DynamicMetaDataImpl.java:200)
at com.sun.jmx.mbeanserver.MetaDataImpl.invoke(MetaDataImpl.java:183)
at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke(DefaultMBeanServerInterceptor.java:865)
at com.sun.jmx.mbeanserver.JmxMBeanServer.invoke(JmxMBeanServer.java:772)
at com.sun.jmx.mbeanserver.MXBeanInvocationHandler$InvokeHandler.invoke(MXBeanInvocationHandler.java:152)
at com.sun.jmx.mbeanserver.MXBeanInvocationHandler.invoke(MXBeanInvocationHandler.java:191)
at javax.management.MBeanServerInvocationHandler.invoke(MBeanServerInvocationHandler.java:311)
... 2 more
Caused by: javax.management.openmbean.OpenDataException: Error calling getter for lockInfo: javax.management.openmbean.OpenDataException: Error calling getter for className: java.lang.NullPointerException
at com.sun.jmx.mbeanserver.OpenConverter.openDataException(OpenConverter.java:1333)
at com.sun.jmx.mbeanserver.OpenConverter$CompositeConverter.toOpenValue(OpenConverter.java:775)
at com.sun.jmx.mbeanserver.OpenConverter$ArrayConverter.toOpenValue(OpenConverter.java:512)
at com.sun.jmx.mbeanserver.ConvertingMethod.invokeWithOpenReturn(ConvertingMethod.java:170)
... 12 more
Caused by: javax.management.openmbean.OpenDataException: Error calling getter for className: java.lang.NullPointerException
at com.sun.jmx.mbeanserver.OpenConverter.openDataException(OpenConverter.java:1333)
at com.sun.jmx.mbeanserver.OpenConverter$CompositeConverter.toOpenValue(OpenConverter.java:775)
at com.sun.jmx.mbeanserver.OpenConverter$CompositeConverter.toOpenValue(OpenConverter.java:773)
... 14 more
Caused by: java.lang.NullPointerException
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.OpenConverter$CompositeConverter.toOpenValue(OpenConverter.java:772)
... 15 more
- relates to
-
JDK-6305746 MXBeans should support null values everywhere
- Closed