HBASE-11603 Apply version of HADOOP-8027 to our JMXJsonServlet

This commit is contained in:
stack 2014-07-28 15:58:08 -07:00
parent 7d4dbb18d1
commit c71d1f6a02
1 changed files with 10 additions and 0 deletions

View File

@ -34,6 +34,7 @@ import javax.management.MBeanServer;
import javax.management.MalformedObjectNameException;
import javax.management.ObjectName;
import javax.management.ReflectionException;
import javax.management.RuntimeMBeanException;
import javax.management.RuntimeErrorException;
import javax.management.RuntimeMBeanException;
import javax.management.openmbean.CompositeData;
@ -248,6 +249,15 @@ public class JMXJsonServlet extends HttpServlet {
prs = attribute;
attributeinfo = mBeanServer.getAttribute(oname, prs);
}
} catch (RuntimeMBeanException e) {
// UnsupportedOperationExceptions happen in the normal course of business,
// so no need to log them as errors all the time.
if (e.getCause() instanceof UnsupportedOperationException) {
LOG.debug("getting attribute " + oname + " of "+oname+" threw an exception", e);
} else {
LOG.error("getting attribute " + oname + " of "+oname+" threw an exception", e);
}
return;
} catch (AttributeNotFoundException e) {
// If the modelerType attribute was not found, the class name is used
// instead.