If an exception propagator is configured, take this one, otherwise go with default that
is providing JCache compatible behavior.
422621
private void setupExceptionPropagator() {
    if (cache2kConfiguration.getExceptionPropagator() != null) {
      return;
    }
    cache2kConfiguration.setExceptionPropagator(
      new CustomizationReferenceSupplier<ExceptionPropagator<K>>(new ExceptionPropagator<K>() {
      @Override
      public RuntimeException propagateException(Object key, final ExceptionInformation exceptionInformation) {
        return new CacheLoaderException("propagate previous loader exception", exceptionInformation.getException());
      }
    }));
  }
958617
private int setExceptionalCompletion(Throwable ex) {
        int s = recordExceptionalCompletion(ex);
        if ((s & DONE_MASK) == EXCEPTIONAL)
            internalPropagateException(ex);
        return s;
    }
1121081
public final void setUncheckedLocalException(Throwable ex) throws EJBException {
        ExceptionMappingStrategy exceptionStrategy = getExceptionMappingStrategy();
        Throwable mappedException = exceptionStrategy.setUncheckedException(this, ex);
        if (mappedException != null) {
            if (mappedException instanceof EJBException) {
                throw (EJBException) mappedException;
            } else if (mappedException instanceof RuntimeException) {
                throw (RuntimeException) mappedException;
            } else if (mappedException instanceof Error) {
                throw (Error) mappedException;
            } else {
                // Unless there is a defect in mapping strategy, this should
                // never happen.  But if it does, we are going to
                // wrap what is returned with a EJBException. This is added
                // measure to ensure we do not break applications that
                // existed prior to EJB 3.
                if (TraceComponent.isAnyTracingEnabled() && tc.isEventEnabled()) {
                    Tr.event(tc, "unexpected Throwable returned by exception mapping strategy", new Object[] { mappedException, exceptionStrategy });
                }
                throw ExceptionUtil.EJBException(mappedException);
            }
        }
    }
919461
private static boolean mightInheritFromException(ClassDescriptor d) {
        while (d != null) {
            try {
                if ("java.lang.Exception".equals(d.getDottedClassName())) {
                    return true;
                }
                XClass classNameAndInfo = Global.getAnalysisCache().getClassAnalysis(XClass.class, d);
                d = classNameAndInfo.getSuperclassDescriptor();
            } catch (CheckedAnalysisException e) {
                return true; // don't know
            }
        }
        return false;
    }
240779
public ExceptionThrownRule getExceptionThrownRule(Throwable ex) {
        ExceptionThrownRule exceptionThrownRule = null;
        int deepest = Integer.MAX_VALUE;
        for (Map.Entry<String, ExceptionThrownRule> entry : exceptionThrownRuleMap.entrySet()) {
            int depth = getMatchedDepth(entry.getKey(), ex);
            if (depth >= 0 && depth < deepest) {
                deepest = depth;
                exceptionThrownRule = entry.getValue();
            }
        }
        return (exceptionThrownRule != null ? exceptionThrownRule : defaultExceptionThrownRule);
    }
121671
private void resolveExceptionDestination(BaseDestinationDefinition dd) {

        String thisMethodName = "resolveExceptionDestination";

        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) {
            SibTr.entry(tc, thisMethodName, dd.getName());
        }

        // If variable substitution string detected, then override ED name
        if (dd.isLocal()) {
            String ed = ((DestinationDefinition) dd).getExceptionDestination();
            if ((ed != null) && (ed.equals(JsConstants.DEFAULT_EXCEPTION_DESTINATION))) {
                ((DestinationDefinition) dd).setExceptionDestination(JsConstants.EXCEPTION_DESTINATION_PREFIX + this.getName());
            }
        }

        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) {
            SibTr.exit(tc, thisMethodName);
        }
    }
793122
private void lifeCycleExceptionHandler(Throwable t, EJBModuleMetaDataImpl mmd) // F743-14982
    {
        if (t instanceof RuntimeException) {
            // Is the RuntimeException an application exception?
            RuntimeException rtex = (RuntimeException) t;
            if (mmd.getApplicationExceptionRollback(rtex) != null) // F743-14982
            {
                // Yes it is, which is not valid for lifecycle callback
                // methods.  So turn this into a system runtime exception.
                InterceptorProxy w = ivInterceptorProxies[ivNextIndex - 1];
                String lifeCycle = w.getMethodGenericString();
                EJBException ex = ExceptionUtil.EJBException(lifeCycle
                                                             + " is not allowed to throw an application exception", rtex);
                if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
                    Tr.debug(tc, "lifeCycleExceptionHandler throwing EJBException", ex);
                }
                throw ex;
            } else {
                // Not an application exception, so let the mapping
                // strategy handle this system runtime exception.
                if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
                    Tr.debug(tc, "lifeCycleExceptionHandler is rethrowing RuntimeException "
                                 + "from lifecycle callback method: " + t,
                             t);
                }
                throw rtex;
            }
        } else if (t instanceof Error) {
            // Let the mapping strategy handle this unchecked exception.
            if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
                Tr.debug(tc, "lifeCycleExceptionHandler is rethrowing Error from "
                             + "lifecycle callback method: " + t,
                         t);
            }
            throw (Error) t;
        } else {
            // Must be a checked exception, which should never happen since
            // InterceptorMetaDataFactory throws EJBConfigurationException
            // and does a Tr.error using message key of INVALID_LIFECYCLE_SIGNATURE_CNTR0231E
            // if interceptor method throws clause is not empty. But if
            // it does happen, wrap the exception in a special EJBException
            // that does not include EJB container in the exception stack.
            InterceptorProxy w = ivInterceptorProxies[ivNextIndex - 1]; // d367572.7
            String lifeCycle = w.getMethodGenericString(); // d367572.7
            EJBException ex = ExceptionUtil.EJBException(lifeCycle
                                                         + " is not allowed to throw a checked exception", t);
            if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) // d367572.7
            {
                Tr.debug(tc, "lifeCycleExceptionHandler throwing EJBException", ex);
            }
            throw ex;
        }
    }
1340583
public static RuntimeException propagate(Throwable throwable) {
    final Throwable t = Preconditions.checkNotNull(throwable, "throwable");
    if (t instanceof Error) {
      throw (Error) t;
    }
    if (t instanceof RuntimeException) {
      throw (RuntimeException) t;
    }

    throw new RuntimeException(t);
  }
738316
private RuntimeException propagateTableNotStashed(TableNotStashedException e)
            throws TableNotStashedException, UnknownTableException {
        if (_dataStore.getTableExists(e.getTable())) {
            throw e;
        }
        throw new UnknownTableException(e.getTable());
    }
386879
private void configureExceptionResolvers() {
        Map<String, HandlerExceptionResolver> resolvers = this.factory.getBeansOfType(HandlerExceptionResolver.class);
        DefaultHandlerExceptionResolver defaultResolver;

        if (resolvers.isEmpty()) {
            defineBean(ExceptionHandlerExceptionResolver.class);
            defineBean(ResponseStatusExceptionResolver.class);
            defaultResolver = defineBean(DefaultHandlerExceptionResolver.class);
        } else {
            defaultResolver = getBean(DefaultHandlerExceptionResolver.class).orElse(null);
        }

        if (defaultResolver != null) {
            defaultResolver.setWarnLogCategory("mvc");
        }
    }
1270749
public final void exceptionOccured( JMSException exception )
    {
        try
        {
        	synchronized (exceptionListenerLock)
        	{
        		if (exceptionListener != null)
        			exceptionListener.onException(exception);
        	}
        }
        catch (Exception e)
        {
            log.error("Exception listener failed",e);
        }
    }
838777
private void rethrowOrSwallowIfBackup(CacheNotExistsException e) throws Exception {
        if (this instanceof BackupOperation) {
            getLogger().finest("Error while getting a cache", e);
        } else {
            throw ExceptionUtil.rethrow(e, Exception.class);
        }
    }
960854
public boolean shouldRetain(Object key, Object val)
  {
    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
      tc.entry(this,cclass, "shouldRetain", new Object[] { key, val });
    CacheEntry e = (CacheEntry) val;
    if (e.exactMatcher != null)
    {
      if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
        tc.exit(this,cclass, "shouldRetain", Boolean.TRUE);
      return true;
    }
    cacheRemoves++;
    
    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
      tc.exit(this,cclass, "shouldRetain", Boolean.FALSE);
    return false;
  }
45340
private static boolean isAdaptiveException(Throwable t) {
        if (t instanceof FrameTooLongException) {
            return true;
        }

        if (t instanceof NoHostAvailableException) {
            // If the issue on every host is adaptive then the exception is adaptive
            Collection<Throwable> hostExceptions = ((NoHostAvailableException) t).getErrors().values();
            return !hostExceptions.isEmpty() && hostExceptions.stream().allMatch(AdaptiveResultSet::isAdaptiveException);
        }

        return false;
    }
793955
private void onHandlerEntry() {
        if (enabled) {
            Type exceptionType = handlers.get(handlerPendingInstruction);

            // Clear the pending instruction flag
            handlerPendingInstruction = null;

            // Filter the interested down to this exception
            Set<ProbeListener> filtered = new HashSet<ProbeListener>();
            for (ProbeListener listener : enabledListeners) {
                ListenerConfiguration config = listener.getListenerConfiguration();
                ProbeFilter filter = config.getTransformerData(EXCEPTION_FILTER_KEY);
                if (filter.isBasicFilter() && filter.basicClassNameMatches(exceptionType.getClassName())) {
                    filtered.add(listener);
                } else if (filter.isAdvancedFilter()) {
                    Class<?> clazz = getOwningClass(exceptionType.getInternalName());
                    if (clazz != null && filter.matches(clazz)) {
                        filtered.add(listener);
                    }
                }
            }

            if (filtered.isEmpty()) {
                return;
            }

            String key = createKey(exceptionType);
            ProbeImpl probe = getProbe(key);
            long probeId = probe.getIdentifier();

            setProbeInProgress(true);
            visitInsn(DUP); // throwable throwable
            visitLdcInsn(Long.valueOf(probeId)); // throwable throwable long1 long2
            visitInsn(DUP2_X1); // throwable long1 long2 throwable long1 long2
            visitInsn(POP2); // throwable long1 long2 throwable
            if (isStatic()) {
                visitInsn(ACONST_NULL); // throwable long1 long2 throwable this
            } else {
                visitVarInsn(ALOAD, 0); // throwable long1 long2 throwable this
            }
            visitInsn(SWAP); // throwable long1 long2 this throwable
            visitInsn(ACONST_NULL); // throwable long1 long2 this throwable null
            visitInsn(SWAP); // throwable long1 long2 this null throwable
            visitFireProbeInvocation(); // throwable
            setProbeInProgress(false);

            setProbeListeners(probe, filtered);
        }
    }
65852
private void processConfigUrl(URL url) throws Exception {
        final String methodName = "processConfigUrl()";
        if (tc.isEntryEnabled())
            Tr.entry(tc, methodName + " configUrl=" + url);

        processedUrls.add(url);
        Properties props = new Properties();
        InputStream is = url.openStream();
        try {
            props.load(is);
        } finally {
            is.close();
        }

        int i = 0;
        VariableRegistry vr = variableRegistryRef.get();
        boolean found = false;
        do {
            // Look for instance name ( JNDI name == cacheName )
            String instancekey = "cache.instance." + i;
            String instanceName = props.getProperty(instancekey);

            // Remove leading forward slash
            if (instanceName != null && instanceName.charAt(0) == '/')
                instanceName = instanceName.substring(1);

            // Do we have an instance name?
            if (instanceName != null) {
                instanceName = instanceName.trim();
                if (tc.isDebugEnabled())
                    Tr.debug(tc, methodName + " Adding new cache instance. instanceName=" + instanceName);
                found = true;

                // Build a vMap converted properties object
                Iterator<Object> it = props.keySet().iterator();
                Properties ccProps = new Properties();
                ccProps.put(CacheConfig.CACHE_NAME, instanceName);
                while (it.hasNext()) {
                    String s = (String) it.next();
                    if (s.startsWith(instancekey + ".")) {
                        String value = vr.resolveString(props.getProperty(s)).trim();
                        if (tc.isDebugEnabled())
                            Tr.debug(tc, methodName + " Adding property: " + s + " value:" + value);
                        ccProps.put("com.ibm.ws.cache.CacheConfig" + s.substring(instancekey.length()), value);
                        // for external cache provider access
                        String unmodifiedKey = s.substring(instancekey.length() + 1);
                        if (tc.isDebugEnabled()) {
                            Tr.debug(tc, methodName + " Adding property: " + unmodifiedKey + " value:" + value);
                        }
                        ccProps.put(unmodifiedKey, value);
                    }
                }
                if (tc.isDebugEnabled())
                    Tr.debug(tc, methodName + " Final props=" + ccProps);

                // ------------------------------------------------------------
                // Bind to JNDI if the cache & the config do not exist
                // ------------------------------------------------------------
                DCache c = ServerCache.getCache(instanceName);

                CacheService cs = getCacheService();
                CacheConfig cacheConfig = cs.getCacheInstanceConfig(instanceName);
                if (c == null && cacheConfig == null) {
                    cacheConfig = cs.addCacheInstanceConfig(ccProps);
                    if (cacheConfig.isCreateCacheAtServerStartup()) {
                        if (tc.isDebugEnabled()) {
                            Tr.debug(tc, "Create cache instance \"" + instanceName + "\" during startup because the cache is configured to.");
                        }
                        ServerCache.createCache(cacheConfig.getCacheName(), cacheConfig);
                    }
                } else {
                    // In this case, the instanceName already exists, so output
                    // a
                    // warning message for the user
                    // DYNA1057W=DYNA1057W: Cache instance \"{0}\" defined in
                    // the \"{1}\" is not added because a cache with this name
                    // already exists.
                    // DYNA1057W.explanation=The cache instance is not added
                    // because a cache with this name already exists.
                    // DYNA1057W.useraction=Ensure that the cache instance does
                    // not define more than once in the properties file.
                    Tr.warning(tc, "DYNA1057W", new Object[] { instanceName, url.toString() });
                }
            } else {
                found = false;
            }
            i++;
        } while (found);

        if (tc.isEntryEnabled())
            Tr.exit(tc, methodName + " configUrl=" + url);
    }
1214254
@Trivial // disable autotrace because tracing of the JCache operations will include all of the useful information
    void configureMonitoring(String cacheName) {
        final boolean trace = TraceComponent.isAnyTracingEnabled();

        boolean enable = monitorRef.get() != null;

        if (trace && tc.isDebugEnabled())
            CacheHashMap.tcInvoke(tcCacheManager, "enableManagement", cacheName, enable);
        cacheManager.enableManagement(cacheName, enable);
        if (trace && tc.isDebugEnabled()) {
            CacheHashMap.tcReturn(tcCacheManager, "enableManagement");
            CacheHashMap.tcInvoke(tcCacheManager, "enableStatistics", cacheName, enable);
        }
        cacheManager.enableStatistics(cacheName, enable);
        if (trace && tc.isDebugEnabled())
            CacheHashMap.tcReturn(tcCacheManager, "enableStatistics");
    }