code: private Object notifySecurityCollaboratorPreInvoke(EJBSecurityCollaborator<?> collaborator, EJBRequestData request) throws CSIException {
          try {
              return collaborator.preInvoke(request);
          } catch (EJBAccessException ex) {
              // The CSI exception created here will eventually be mapped back to an
              // EJBAccessException, so avoid setting the cause so that we don't end
              // up with an EJBAccessException chained to an EJBAccessException.
              // Also, security actually throws an 'internal' subclass of
              // EJBAccessException that will not deserialize on a client.
              CSIAccessException csiEx = new CSIAccessException(ex.getMessage());
              csiEx.setStackTrace(ex.getStackTrace());
              throw csiEx;
          } catch (RuntimeException ex) {
              throw ex;
          } catch (CSIException ex) {
              throw ex;
          } catch (Exception ex) {
              throw new CSIException("", ex);
          }
      }
docs: Notify the security collaborator for pre-invoke. This method handles
  exception mapping for EJBSecurityCollaborator that throw
  EJBAccessException rather than the legacy CSIAccessException.