Skip to content
New issue

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

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

Already on GitHub? # to your account

ClassNotFoundException during AOT processing of Logback XML that references a variable when defining a component's class #34336

Closed
justin-tay opened this issue Feb 22, 2023 · 0 comments
Assignees
Labels
type: bug A general bug
Milestone

Comments

@justin-tay
Copy link

Performing AOT processing of a logback configuration xml with variables as the class name throws a java.lang.ClassNotFoundException in org.springframework.boot.logging.logback.SpringBootJoranConfigurator.

I have created a reproducer at https://github.com/justin-tay/spring-boot-logback-issue which demonstrates the issue.

Running mvnw spring-boot:run shows that it runs normally and logback substitutes the variable for the class name.

Running mvnw spring-boot:process-aot shows the exception.

In logback the relevant code performing the substitution is

https://github.com/qos-ch/logback/blob/bba7a908c87a4a483860f6d49695ec2348c56e49/logback-core/src/main/java/ch/qos/logback/core/model/processor/ImplicitModelHandler.java#L126

I think that in Spring Boot the following should also likewise add code to perform the substitution

return loadComponentType(this.modelInterpretationContext.getImport(className));

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged label Feb 22, 2023
@wilkinsona wilkinsona changed the title AOT issue processing logback variables for class names ClassNotFoundException during AOT processing of Logback XML that references a variable when defining a component's class Feb 22, 2023
@wilkinsona wilkinsona added type: bug A general bug and removed status: waiting-for-triage An issue we've not yet triaged labels Feb 22, 2023
@wilkinsona wilkinsona added this to the 3.0.x milestone Feb 22, 2023
@wilkinsona wilkinsona self-assigned this Feb 22, 2023
@wilkinsona wilkinsona modified the milestones: 3.0.x, 3.0.3 Feb 22, 2023
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
type: bug A general bug
Projects
None yet
Development

No branches or pull requests

3 participants