private static void bootstrap() {
        var configurationManagers = ServiceLoader.load(ConfigurationManager.class, Configuration.class.getClassLoader());
        if (configurationManagers.findFirst().isEmpty())
            configurationManagers = ServiceLoader.load(ConfigurationManager.class);
        final List<ConfigurationManager> configurationManagerList = new ArrayList<>();
        configurationManagers.forEach(configurationManagerList::add);
        if (!configurationManagerList.isEmpty()) {
            configurationManagerList.sort(FrameworkAdapter.INSTANCE::compareManagers);
            configurationManagerList.get(0).configure();
        }

        try {
            var parserPool = new BasicParserPool();
            parserPool.setMaxPoolSize(1_000);
            parserPool.setCoalescing(true);
            parserPool.setIgnoreComments(true);
            parserPool.setNamespaceAware(true);
            parserPool.setExpandEntityReferences(false);
            parserPool.initialize();
            XMLObjectProviderRegistrySupport.setParserPool(parserPool);
        } catch (Exception e) {
            LOGGER.error("Error initializing parser pool", e);
            throw new SAMLException(e.getMessage(), e);
        }
    }
OpenSAML configuration bean to bootstrap the parser pool.

Uses the Java service API to find an instance of {@link ConfigurationManager} to do the actual configuration. Will
use the implementation with the lowest javax|jakarta.annotation.Priority annotation. If none are found, a relatively sane
implementation, {@link DefaultConfigurationManager}, will be used. The default priority is 100.

@see ServiceLoader
@author Misagh Moayyed
@since 1.7
pac4j-saml/src/main/java/org/pac4j/saml/util/Configuration.java