List of usage examples for java.security AccessControlException getCause
public synchronized Throwable getCause()
From source file:org.apache.qpid.server.management.plugin.servlet.rest.AbstractServlet.java
private void doWithSubjectAndActor(PrivilegedExceptionAction<Void> privilegedExceptionAction, final HttpServletRequest request, final HttpServletResponse resp) { Subject subject;//from www.j a va 2s. com try { subject = getAndCacheAuthorizedSubject(request); } catch (AccessControlException e) { sendError(resp, HttpServletResponse.SC_FORBIDDEN); return; } SecurityManager.setThreadSubject(subject); try { HttpManagementActor logActor = getLogActorAndCacheInSession(request); CurrentActor.set(logActor); try { Subject.doAs(subject, privilegedExceptionAction); } catch (RuntimeException e) { LOGGER.error("Unable to perform action", e); throw e; } catch (PrivilegedActionException e) { LOGGER.error("Unable to perform action", e); throw new RuntimeException(e.getCause()); } finally { CurrentActor.remove(); } } finally { try { SecurityManager.setThreadSubject(null); } finally { AMQShortString.clearLocalCache(); } } }