Having one of the following errors in IntelliJ?
Could not autowire. No beans of 'yourType' type found
or
Could not autowire. There is more than one bean of 'yourType' type.
If you’re sure you have your Spring bean definitions correct (for me, the application works fine, it just displays an annoying error in the IDE), check your project ‘iml’ file if you have a Spring facet defined.
<facet type="Spring" name="Spring">
<configuration>
<fileset id="web: application context" name="MVC application context" removed="false">
<file>file://$MODULE_DIR$/src/main/resources/spring/applicationContext-interface.xml</file>
</fileset>
</configuration>
</facet>
After removing this facet everything works fine for me.
多谢你的博客!