-
Notifications
You must be signed in to change notification settings - Fork 38.7k
Description
Stepan Koltsov opened SPR-7979 and commented
Have simple configuration:
public abstract class Aaaaa { }
public class Bbbbb extends Aaaaa { }
@Configuration
@ComponentScan
(
basePackages="com.mycompany",
useDefaultFilters=false,
includeFilters={
@ComponentScan
.Filter(type=FilterType.ASSIGNABLE_TYPE, value=Aaaaa.class)
}
)public class Conf {
@Autowired
private Bbbbb bbbbb;
}
when loaded with
new AnnotationConfigApplicationContext(Conf.class)
works fine, however, when loaded with XML config that references Conf.class:
<beans>
<bean class="com.mycompany.Conf"/>
</beans>
new ClassPathXmlApplicationContext("classpath:com/mycompany/conf.xml");
it fails with exception: cannot autowire Conf.bbbbb field. Full stack trace: https://gist.github.com/835493 .
Affects: 3.1 M1
Attachments:
- mylyn-context.zip (236.68 kB)
Issue Links:
- @ComponentScan(includeFilters=@Filter(...)) fails when @Import'ed [SPR-8719] #13361
@ComponentScan
(includeFilters=@Filter
(...)) fails when@Import
'ed ("duplicates") - @ComponentScan with includeFilters on @Import-ed context does not work [SPR-9031] #13670
@ComponentScan
with includeFilters on@Import-ed
context does not work - 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
Referenced from: commits d9f7fdd
1 votes, 0 watchers