-
Notifications
You must be signed in to change notification settings - Fork 38.7k
Closed
Labels
in: coreIssues in core modules (aop, beans, core, context, expression)Issues in core modules (aop, beans, core, context, expression)status: invalidAn issue that we don't feel is validAn issue that we don't feel is valid
Description
Keith Donald opened SPR-7450 and commented
Ran into a rather odd problem. Testing against latest 3.0.4 nightly build.
The following fails with a no default constructor found exception:
<beans:bean id="badgeSystem" class="com.springsource.greenhouse.badge.BadgeSystemFactoryBean"/>
<beans:bean id="badgeRepository" class="com.springsource.greenhouse.badge.JdbcBadgeRepository"/>
The following works:
<beans:bean id="badgeSystem" class="com.springsource.greenhouse.badge.BadgeSystemFactoryBean">
<beans:constructor-arg ref="badgeRepository" />
</beans:bean>
<beans:bean id="badgeRepository" class="com.springsource.greenhouse.badge.JdbcBadgeRepository">
<beans:constructor-arg ref="jdbcTemplate" />
</beans:bean>
The injection points:
@Inject
public BadgeSystemFactoryBean(BadgeRepository badgeRepository) {
this.badgeRepository = badgeRepository;
}
@Inject
public JdbcBadgeRepository(JdbcTemplate jdbcTemplate) {
this.jdbcTemplate = jdbcTemplate;
}
context:annotation-config is turned on.
Strangely, removing the FactoryBean and leaving just the Repository def relying on byType autowiring works:
<beans:bean id="badgeRepository" class="com.springsource.greenhouse.badge.JdbcBadgeRepository" />
Is there something special related to FactoryBean autowiring I'm missing?
Affects: 3.0.3
Issue Links:
- Document BeanFactoryPostProcessor implementation constraints [SPR-7466] #12124 Document BeanFactoryPostProcessor implementation constraints ("is superseded by")
Metadata
Metadata
Assignees
Labels
in: coreIssues in core modules (aop, beans, core, context, expression)Issues in core modules (aop, beans, core, context, expression)status: invalidAn issue that we don't feel is validAn issue that we don't feel is valid