Skip to content

ConfigFileApplicationListener#loadPostProcessors can not load EnvironmentPostProcessor in child classLoader #26126

Closed
@ChenKangQiang

Description

@ChenKangQiang

My spring-boot version is 2.3.3.RELEASE. I want use spring.factories to load EnvironmentPostProcessor.
In my project, I haven a parent-child classLoader structure. ConfigFileApplicationListener.class is loaded by parent classLoader, and my environmentPostProcessorImpl is in child classloader path. The source code show that ConfigFileApplicationListener use its classloader to load EnvironmentPostProcessor. So,it can not load.
image
With Java SPI,it use ThreadContextClassLoader to load implementation class. Why Spring do not use ThreadContextClassLoader? Or is there any other solutions.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions