I have multiple spring config files. Few are for testing.
Throughout the code base Idea12 has highlighted all Autowired beans as "There is more than one bean of XXX type".
How do I configure IDEA so that it correctly identifies the instances to be used in testing and in production?
It's supposed to be fixed in the next update. But meantime just go the Project Structure
->
Facets
->
Spring
and remove some of the application context configurations that include ones already defined.
For instance, I have 2 modules in my project: Core (jar) and Webapp (war) which depends on the Core. When both are included into the Spring facet in IDEA the beans defined in the Core application context are seen twice by IDE: 1st time directly from Core application context and 2nd time from Webapp context which includes Core context. Since Core module beans are already visible in Web module the Spring facet for Core can be removed and the issue will be fixed.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With