Skip to content

ScopedProxyMode resolution for custom scope meta-annotation not working with @Bean methods (with ASM-based scanning) [SPR-13394] #17974

@spring-projects-issues

Description

@spring-projects-issues

Leonard Loesche opened SPR-13394 and commented

The Meta-Annotation for @RefreshScope (as mentioned in the linked ticket) overwrites the default proxyMode (with ScopedProxyMode.TARGET_CLASS) which is unfortunately only working with an annotation at type level (with proxy mode resolution via ClassPathBeanDefinitionScanner and a ScopeMetadataResolver) but not for @Bean annotated methods, which uses a different approach to resolve the proxyMode.
Even setting the proxyMode manually at the custom scope annotation does not help.

There is the 'workaround', not to use the meta annotation but the original @Scope with correct proxyMode at the method, but it would be an improvement to have the same behaviour for the custom scope annotation on both sides.


Affects: 4.1.6, 4.2 GA

Reference URL: spring-cloud/spring-cloud-config#190

Attachments:

Issue Links:

Referenced from: commits 75187e3, 3430f76

Backported to: 4.1.8

Metadata

Metadata

Assignees

Labels

in: coreIssues in core modules (aop, beans, core, context, expression)status: backportedAn issue that has been backported to maintenance branchestype: bugA general bug

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions