ConfigurationClassParser does not work with scanner-provided ClassLoader [SPR-15245] #19810
Labels
in: core
Issues in core modules (aop, beans, core, context, expression)
status: declined
A suggestion or change that we don't feel we should currently apply
Uh oh!
There was an error while loading. Please reload this page.
Adrian J George III opened SPR-15245 and commented
When using a ClassPathBeanDefinitionScanner with a different class loader than the attached context, ConfigurationClassParser.asSourcreClass abandons the provided classloader and uses the context's loader instead. This leads to the class not being found and a failure of the context to initialize.
This line
spring-framework/spring-context/src/main/java/org/springframework/context/annotation/ConfigurationClassParser.java
Line 627 in 5b98a54
calls through to
spring-framework/spring-context/src/main/java/org/springframework/context/annotation/ConfigurationClassParser.java
Line 659 in 5b98a54
which uses the local class loader.
The problem can be reproduced here
https://github.com/adrianjgeorge/classloading-poc
Affects: 4.3.6
Issue Links:
The text was updated successfully, but these errors were encountered: