ScopedProxyMode resolution for custom scope meta-annotation not working with @Bean methods (with ASM-based scanning) [SPR-13394] #17974
Labels
in: core
Issues in core modules (aop, beans, core, context, expression)
status: backported
An issue that has been backported to maintenance branches
type: bug
A general bug
Milestone
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 viaClassPathBeanDefinitionScanner
and aScopeMetadataResolver
) 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:
@Bean
methodsReferenced from: commits 75187e3, 3430f76
Backported to: 4.1.8
The text was updated successfully, but these errors were encountered: