Previously, classes involved in config loading used a variety of potentially different class loaders when calling SpringFactoriesLoader. Some classes would use their own class loader and others would use null which results in SpringFactoriesLoader's class loader being used.

This commit updates the config loading classes to consistently use the resource loader's class loader.

Fixes gh-26126 Back patch for https://github.com/spring-projects/spring-boot/issues/26689

Comment From: snicoll

Thanks for the PR but we intentionally decided to only fix this in 2.5.x.