Skip to content

Support for InjectionPoint in bean factory methods when using AOT #30401

Closed
@f-cramer

Description

@f-cramer

Affects: Spring Framework 6.0.8

When using AOT (via gradle bootBuildImage task) any bean factory method that has a parameter of type InjectionPoint results in an UnsatisfiedDependencyException thrown in BeanInstanceSupplier.java:343.

It should be possible to inject such an instance because it is also created when creating the exception.

For an MCVE see here.

When started with ./gradlew :bootRun it successfully executes and logs running logging runner.

When starting the image that is produced with ./gradlew :bootBuildImage it fails with the following message


APPLICATION FAILED TO START


Description:

Parameter 0 of method logger in com.example.injectionpoint.LoggerConfiguration required a bean of type 'org.springframework.beans.factory.InjectionPoint' that could not be found.

Metadata

Metadata

Assignees

Labels

in: coreIssues in core modules (aop, beans, core, context, expression)theme: aotAn issue related to Ahead-of-time processingtype: bugA general bug

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions