Skip to content

Clarify component scanning of abstract classes with @Lookup methods #34367

Closed
@cselagea

Description

@cselagea

According to https://docs.spring.io/spring-framework/reference/core/beans/dependencies/factory-method-injection.html,

Concrete methods are also necessary for component scanning, which requires concrete classes to pick up.

Note that you should typically declare such annotated lookup methods with a concrete stub implementation, in order for them to be compatible with Spring’s component scanning rules where abstract classes get ignored by default.

Abstract @Lookup methods are compatible with component scanning as of 4.3.6 thanks to #19118, so the documentation is incorrect/misleading.

Metadata

Metadata

Assignees

Labels

in: coreIssues in core modules (aop, beans, core, context, expression)status: backportedAn issue that has been backported to maintenance branchestype: documentationA documentation task

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions