-
Notifications
You must be signed in to change notification settings - Fork 38.8k
Closed as not planned
Closed as not planned
Copy link
Labels
in: coreIssues in core modules (aop, beans, core, context, expression)Issues in core modules (aop, beans, core, context, expression)status: declinedA suggestion or change that we don't feel we should currently applyA suggestion or change that we don't feel we should currently apply
Description
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
Line 627 in 5b98a54
| return asSourceClass(metadata.getClassName()); |
calls through to
Line 659 in 5b98a54
| public SourceClass asSourceClass(String className) throws IOException { |
which uses the local class loader.
The problem can be reproduced here
https://github.com/adrianjgeorge/classloading-poc
Affects: 4.3.6
Issue Links:
- ConfigurationClassParser needs to load annotations through source class loader [SPR-10343] #14977 ConfigurationClassParser needs to load annotations through source class loader
Metadata
Metadata
Assignees
Labels
in: coreIssues in core modules (aop, beans, core, context, expression)Issues in core modules (aop, beans, core, context, expression)status: declinedA suggestion or change that we don't feel we should currently applyA suggestion or change that we don't feel we should currently apply