Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

EnvironmentPostProcessors aren't instantiated with correct ClassLoader #27043

Closed
jaminh opened this issue Jun 23, 2021 · 1 comment
Closed

EnvironmentPostProcessors aren't instantiated with correct ClassLoader #27043

jaminh opened this issue Jun 23, 2021 · 1 comment
Assignees
Labels
type: bug A general bug
Milestone

Comments

@jaminh
Copy link
Contributor

jaminh commented Jun 23, 2021

Similar to the issue raised in #26126, when using Spring Boot 2.5.0 org.springframework.boot.env.ReflectionEnvironmentPostProcessorsFactory will not use the class loader from the SpringApplication's ResourceLoader when instantiating EnvironmentPostProcessors.

It appears to me the classloader would need to be passed to the instantiator here

. That way could use the correct classloader rather than being passed "null". ReflectionEnvironmentPostProcessorsFactory would need to be made aware of the SpringApplication's ClassLoader as well.

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged label Jun 23, 2021
@philwebb philwebb added status: first-timers-only An issue that can only be worked on by brand new contributors type: bug A general bug and removed status: waiting-for-triage An issue we've not yet triaged status: first-timers-only An issue that can only be worked on by brand new contributors labels Jun 23, 2021
@philwebb philwebb modified the milestones: 2.5.x, 2.4.x Jun 23, 2021
@philwebb philwebb self-assigned this Jun 24, 2021
@philwebb philwebb modified the milestones: 2.4.x, 2.5.x Jun 24, 2021
@philwebb
Copy link
Member

There are two parts to this bug. The first is that we're not passing a classloader to the Instantiator, the second is that we want to use ResourceLoader.getClassloader().

I'll use this issue to fix the first problem in 2.4.x. The second part we'll fix in 2.5.x under #27071

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug A general bug
Projects
None yet
Development

No branches or pull requests

3 participants