Skip to content

ConfigurationClassParser does not work with scanner-provided ClassLoader [SPR-15245] #19810

Closed as not planned
@spring-projects-issues

Description

@spring-projects-issues

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


calls through to
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:

Metadata

Metadata

Assignees

No one assigned

    Labels

    in: coreIssues in core modules (aop, beans, core, context, expression)status: declinedA suggestion or change that we don't feel we should currently apply

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions