Use ResourceLoader.getClassLoader() for factories
Update `SpringApplication` to load and initialize `spring.factories` classes using the `ResourceLoader.getClassLoader()`. Closes gh-14641
This commit is contained in:
parent
daa3d457b7
commit
6baaa3df77
|
@ -447,7 +447,7 @@ public class SpringApplication {
|
|||
|
||||
private <T> Collection<T> getSpringFactoriesInstances(Class<T> type,
|
||||
Class<?>[] parameterTypes, Object... args) {
|
||||
ClassLoader classLoader = Thread.currentThread().getContextClassLoader();
|
||||
ClassLoader classLoader = getClassLoader();
|
||||
// Use names and ensure unique to protect against duplicates
|
||||
Set<String> names = new LinkedHashSet<>(
|
||||
SpringFactoriesLoader.loadFactoryNames(type, classLoader));
|
||||
|
|
Loading…
Reference in New Issue