-
Notifications
You must be signed in to change notification settings - Fork 38.6k
Description
Michael Donaghy opened SPR-9031 and commented
It seems that using @ComponentScan
with an includeFilters set only works for top-level contexts, not for @Imported
contexts? See the attached minimal example maven project: the LowLevelContext works correctly, but the HighLevelContext does not, even though all the HighLevelContext does is to @Import
the LowLevelContext.
Stepping through in a debugger I found that different AnnotationMetadata implementations are passed to ConfigurationClassParser#doProcessConfigurationClass in the two cases:
For LowLevelContext a StandardAnnotationMetadata is used (and behaves correctly).
For HighLevelContext an AnnotationMetadataReadingVisitor is used, and seems to return an empty array from getAnnotationAttributes(ComponentScan.class.getName()).get("includeFilters"), which is incorrect.
Affects: 3.1 GA
Attachments:
- springproblem.tar.gz (1.58 kB)
Issue Links:
- @ComponentScan(includeFilters=@Filter(...)) fails when @Import'ed [SPR-8719] #13361
@ComponentScan
(includeFilters=@Filter
(...)) fails when@Import
'ed ("is duplicated by") - ClassPathBeanDefinitionScanner vs ClassPathBeanDefinitionScanner: difference in behavior when dealing with @ComponentScan excludeFilters [SPR-9100] #13738 ClassPathBeanDefinitionScanner vs ClassPathBeanDefinitionScanner: difference in behavior when dealing with
@ComponentScan
excludeFilters ("is duplicated by") - @ComponentScan does not work when referenced from XML config [SPR-7979] #12634
@ComponentScan
does not work when referenced from XML config - Reduce log level for message re: missing annotation [SPR-9233] #13871 Reduce log level for message re: missing annotation
Referenced from: commits spring-attic/spring-framework-issues@dd79a1b