报告 Spring Bean 构造函数上不正确的 @Autowired
用法:多个 @Autowired
构造函数、没有匹配的 @Autowired
构造函数,等等。
示例:
@Component
public class MyComponent {
@Autowired
public MyComponent(BarBean bean) {...} // 报告 '只允许一个 @Autowired 构造函数'
@Autowired
public MyComponent(FooBean bean) {...} // 报告 '只允许一个 @Autowired 构造函数'
}
@Component
public class MyFactory { // 报告 '没有匹配的 @Autowired 构造函数'
public MyFactory(String str) {...}
public MyFactory(int count) {...}
}