List of usage examples for javax.management RuntimeMBeanException getTargetException
public java.lang.RuntimeException getTargetException()
From source file:com.nesscomputing.jmx.jolokia.JolokiaServlet.java
private void handle(final ServletRequestHandler reqHandler, final HttpServletRequest req, final HttpServletResponse resp) throws IOException { JSONAware json = null;/*from ww w . j a v a 2 s .c o m*/ try { // Check access policy requestHandler.checkClientIPAccess(req.getRemoteHost(), req.getRemoteAddr()); // Dispatch for the proper HTTP request method json = reqHandler.handleRequest(req, resp); if (backendManager.isDebug()) { backendManager.debug("Response: " + json); } } catch (RuntimeMBeanException rme) { json = requestHandler.handleThrowable(rme.getTargetException()); } catch (Throwable exp) { json = requestHandler.handleThrowable(exp); } finally { final String callback = req.getParameter(ConfigKey.CALLBACK.getKeyValue()); if (callback != null) { // Send a JSONP response sendResponse(resp, "text/javascript", callback + "(" + json.toJSONString() + ");"); } else { sendResponse(resp, "application/json", json.toJSONString()); } } }