This Exception is thrown when a bean depends on other beans or some simple properties that were not specified in the bean factory definition, although dependency checking was enabled.
Just look at below classes for detailed Explanation.
In the class DemoController we are injecting 'BusinessService' class as dependency and because spring container did not find the bean of 'BusinessService' type, so spring container is unable to instantiate that class, and we are getting the exception
If you look closely at BusinessService class, we are making one mistake i.e. we are not annotating the class with @Service, and spring container is not in the position to create this bean, so that's why we are getting this exception
Just annotate 'BusinessService' class with @Service, and the code works fine
Whenever this exception occurs, just decide the role of that particular class and mark the class with corresponding role like:
1. if your class is meant to be Data Access annotate, then that class with @Repository
2. if your class is meant to be Buisness logic, then annotate that class with @Service
3. if your class is meant to be Controller, then annotate that class with @Controller
4. if your class is meant to be Generic Access, then annotate that class with @Component