ex.getMessage());
ThrowableBean throwableBean = new ThrowableBean(ex);
response.setStatus(HttpServletResponse.SC_INTERNAL_SERVER_ERROR);
response.getWriter().write(throwableBean.extract(true).toJSONString());
} else {
response.sendError(HttpServletResponse.SC_INTERNAL_SERVER_ERROR);
}
}