No matching bean of type dao found for depende

Problem scenario:
Project design mode: Spring MVC + MyBatis
fails to start the service, and the console prints a system exception.
The general idea of ​​the exception is as follows:
xxxService failed to load xxxInterface or xxxMapper
The last exception No matching bean of type [xxxService] found for dependeException

analysis:
From the perspective of the exception itself: the interface with the dependency could not be found or the loading error existed a long time ago, so There will be no problem,
so look for the problem from the latest modification or new interface. Locate xxxService to solve the

problem:
Usually No matching bean of type dao found for depende exception occurs, because ServiceImpl does not add the @Service tag
, but this xxxService already exists. Compared with the historical version, try to comment out the newly added code.

Location reason:
a When my colleague was writing the interface implementation, he added a new method out of thin air, but the new method was not implemented and became an abstract method. Then he changed the current ServiceImpl class to the abstract class according to Eclipse's prompt, so run Exception

Problem experience:
The service fails to start due to the loading exception or the problem that the dependency cannot be found. Quickly locate the newly added interface or the method in the interface, and quickly find the problem. Service is the ServiceImpl class to find problems.
Self-test , Junit self-test, The code must be submitted after passing the self-test, otherwise, it will not only pit itself, but also pit teammates.

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=326757300&siteId=291194637