This week's book giveaway is in the Agile and Other Processes forum. We're giving away four copies of Software Teaming: A Mob Programming, Whole-Team Approach and have Woody Zuill and Kevin Meadows on-line! See this thread for details.
"No unique bean of type is defined: expected single matching bean but found 2" error normally appear at the time of wiring. As you are using component scan, I assume there should be more code where the error might be appearing during wiring.
If above is not the case, Can you please provide the error stack trace. That would help us in identifying the root cause of the problem?
As suggested by Krishna, please remove duplicate entry from you xml file.
Ok worked it out, as I am using JpaRepository I do not need to create a concrete implemention class its using the bean FundRepository as the repository type.
By adding a concrete repository class FundRepositoryImpl which is defined as a repository @Repository
Spring then saw two repository type beans FundRepositoryImpl and FundRepository .
The solution is to not define a concrete class FundRepositoryImpl if using JpaRepository.