docs: @Override
      public final Throwable setUncheckedException(EJSDeployedSupport s, Throwable ex) // d395666
      {
          // d161864 Begins
          if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) {
              Tr.entry(tc, "setUncheckedException in param:" + ex); //150727
          }
          // d161864 Ends
  
          // d395666 start
          // Entering this method for a second time?
          if (s.ivException != null)
          {
              // Yep, this is the second time, so we will just keep the original exception.
              if (TraceComponent.isAnyTracingEnabled() && tc.isEventEnabled())
              {
                  Tr.event(tc, "setting unchecked exception again", ex);
                  Tr.event(tc, "original exception", s.ivException);
                  Tr.exit(tc, "setUncheckedException returning: " + s.ivException); // d402055
              }
              return s.ivException;
          }
  
          // Nope, this is first time this method entered.
  
          // If the method was invoked on an interface from an EJB 3.0
          // (or later) module and a non-RemoteException occurred, then the
          // new applicaiton exception processing must be performed.
          // This new support is enabled for both component and business
          // interfaces in an EJB 3.0 module.                              396839
          Boolean applicationExceptionRollback = null;
          int moduleVersion = s.ivWrapper.bmd.ivModuleVersion;
          if (moduleVersion >= BeanMetaData.J2EE_EJB_VERSION_3_0 &&
              ex instanceof Exception && // d423621
              !(ex instanceof RemoteException))
          {
              // Yep, check whether it is annotated as an ApplicationException.
              applicationExceptionRollback = s.getApplicationExceptionRollback(ex);
          }
  
          // Did above code result in ExceptionType being set to a
          // checked exception?
          if (applicationExceptionRollback != null)
          {
              // Yep, it must be an AppplicationException, so just store it
              // in ivException so that it gets rethrown.
              if (TraceComponent.isAnyTracingEnabled() && tc.isEventEnabled())
              {
                  Tr.event(tc, "ApplicationException with rollback set to true, changing to a checked exception", ex);
              }
  
              s.exType = ExceptionType.CHECKED_EXCEPTION;
              s.ivException = ex;
              s.rootEx = ex;
  
              // Is rollback set to true for the ApplicationException?
              if (applicationExceptionRollback == Boolean.TRUE)
              {
                  if (TraceComponent.isAnyTracingEnabled() && tc.isEventEnabled())
                  {
                      Tr.event(tc, "ApplicationException with rollback set to true, setting rollback only", ex);
                  }
                  s.currentTx.setRollbackOnly();
              }
  
              if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
              {
                  Tr.exit(tc, "setUncheckedException returning: " + s.ivException);
              }
  
              return s.ivException;
          }
          // d395666 end
  
          // Not a EJB 3 ApplicationException, so pre-EJB 3 checking.
  
          // If the bean failed to activate because it was found to not
          // exist (original exception is NoSuchObjectException), assume the
          // exception type to be checked exception so that no rollback will
          // be performed during transaction control in post-invoke processing.
          // Otherwise, set the type to unchecked exception and log it
          // as required by the EJB specification.                      d116274.1
          // Also, as determined by CTS, when BeanNotReentrantException
          // occurs in preInvoke, it is not considered that the method was
          // ever invoked, and so it should be a checked exception and
          // should not cause a rollback.                                 d159491
          // Also, as determined by CTS, an AccessException from the Security
          // Collaborator should not cause a rollback.                    d184062
          // Also, as determined by CTS, for CMR set methods (local only),
          // if an IllegalArgumentException occurs, it should not cause a
          // rollback - the method is not considered invoked.             d184523
          // If a HomeDisableException occurs, or if a CreateFailureException occurs
          // which has nested in it a HomeDisabledException, make this a checked exception.
          // This will have the effect of suppressing the printing of the HomeDisabledException
          // from the system logs as was requested in APAR PK30272.
          if ((s.preInvokeException &&
              (ex instanceof NoSuchObjectException ||
               ex instanceof EJBStoppedException || // d350987
               ex instanceof HomeDisabledException || // d350987
               ex instanceof CSIAccessException ||
              ex instanceof BeanNotReentrantException)) ||
              (!s.preInvokeException &&
               s.methodInfo.isCMRSetMethod &&
              ex instanceof IllegalArgumentException) ||
              ex instanceof HomeDisabledException ||
              (ex instanceof CreateFailureException &&
              (ex.getCause() instanceof HomeDisabledException ||
              ex.getCause() instanceof EJBStoppedException))) // d350987
          {
              if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
              {
                  Tr.debug(tc
                           , "Exception should not cause rollback, "
                             + "changing to checked exception");
              }
  
              // For NoSuchObjectException, the beanO is already null since
              // it occurs during activation, but for BeanNotReentrant, the
              // activation may have succeeded (for Entity beans), but since
              // the method is never invoked, postInvoke processing should
              // not occur on the beanO; so null it out.                   d159491
              if (ex instanceof BeanNotReentrantException)
              {
                  s.beanO = null;
              }
  
              s.exType = ExceptionType.CHECKED_EXCEPTION;
          }
          else if (EJSContainer.defaultContainer == null)
          {
              // If the EJBContainer has been stopped, then likely an ugly exception occurred,
              // like NullPointerException. In this case, just discard the original exception
              // and throw a meaningful one indicating the EJB feature has been removed.
              s.exType = ExceptionType.UNCHECKED_EXCEPTION;
              ex = new EJBException("The Enterprise JavaBeans (EJB) features have been deactivated. No further EJB processing is allowed");
  
              // Log the error message at this point
              ExceptionUtil.logException(tc, ex, s.getEJBMethodMetaData(), s.getBeanO());
  
              // Don't bother with FFDC, it will just be clutter at this point.
          }
          else
          {
              s.exType = ExceptionType.UNCHECKED_EXCEPTION;
  
              // Log the error message at this point
              ExceptionUtil.logException(tc, ex, s.getEJBMethodMetaData(), s.getBeanO());
  
              // FFDC log any unchecked / unexpected exceptions.  d331740
              FFDCFilter.processException(ex
                                          , CLASS_NAME + ".setUncheckedException"
                                          , "178"
                                          , this); //123338
          }
  
          // Find the root cause of the exception.                      d109641.1
          s.rootEx = findRootCause(ex);
  
          // map the exception to the appropriate EJBException        // 117817.1
          s.ivException = mapException(s, ex);
  
          if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) {
              Tr.exit(tc, "setUncheckedException returning: " + s.ivException); //150727
          }
  
          // set the stack trace to be the exception stack for
          // the root cause of the exception.
          s.ivException.setStackTrace(s.rootEx.getStackTrace()); // d180095
  
          return s.ivException; // d117817 // d395666
      }