Issue
I reconfigured my DAOs to a more convenient way (by using JpaRepository) instead of doing all that boilerplate code manually. But now everytime I start the Spring Application it gives me the following error:
APPLICATION FAILED TO START
Description:
Field userRepository in DAO.UserDAOService required a bean of type 'DAO.UserRepository' that could not be found.
The injection point has the following annotations:
- @org.springframework.beans.factory.annotation.Autowired(required=true)
Action:
Consider defining a bean of type 'DAO.UserRepository' in your configuration.
Process finished with exit code 1
Solution
SOLUTION: Just create sub-packages in the same package where you have your Spring appliciation located.
EXAMPLE OF SOLUTION CAN BE FOUND HERE: 'Field required a bean of type that could not be found.' error spring restful API using mongodb
Answered By - NaN
Answer Checked By - Clifford M. (JavaFixing Volunteer)