I'm working on Module3 which is dependent on Module1 and Module2.
Module1 has the following classes:
class Module1Service {
@Autowired
MyBean myBean;
.....
}
@Component("module1MyBean")
class MyBeanImpl implements MyBean{
}
Module2 has the following classes:
class Module2Service {
@Autowired
MyBean myBean;
.....
}
@Component("module2MyBean")
class MyBeanImpl implements MyBean{
}
Unfortunately, both Module1Service and Module2Service do not contain @Resource or @Qualifier. Because of this, I get NonUniqueBeanDefinition exception when I try to bootstrap Module3.
Is there any way I can avoid this exception without making any changes to Module1 or Module2?