First, the problem phenomenon
1,no Bean named ' bommanagemapper ' found in Org.s[email protected] ...
2, I commented out all the references in the code Bommanagemapper, and another mapper object could not be found
3, but oddly, there are two items that are used to start the Mapper object can be found, found that the two Mapper objects are under the project's core package, and other mapper objects cannot be found under the interfaces package;
Second, find the answer
1, the suspicion is yesterday modified what things, resulting in this problem (specifically also remember not clear, so version control is really important, and do a good job is to submit every day);
2, try to restore yesterday's changes, delete some new content, but the problem is still;
Just so tossing the whole morning;
Third, the settlement
Open the spring configuration file to see, there is this line, scan the Mapper and DAO classes:
<class= "Org.mybatis.spring.mapper.MapperScannerConfigurer" P: Basepackage= "Com.skysport.*.dao" p:sqlsessionfactorybeanname= "Sqlsessionfactory" />
It is this DAO, suddenly thought, yesterday put interfaces in the package of the ' DAO ' folder renamed to ' Mapper ', and the core package or DAO package, OK, the problem reason found.
Rename the DAO package in the core package as Mapper package, restart the service and return to normal;
41-Point thinking:
1, about positioning problems:
If you have not appeared before, but have done some changes after the problem, then it must be the modification of the action caused.
2, about version control:
Develop the habit of submitting code on a daily basis, so that you can compare the contents of each day to make it easier to locate the problem;
3, about modification:
When modifying a piece of content, it is important to assess how much impact it has, and I think it can be measured from two angles:
A), quantifiable: Modify a content, if directly affect a lot of file modification, then must be careful, to assess the risk (for example: whether each involved in the place has been modified)
b), not quantifiable: for example, modify the code lock mechanism, may affect on one or two classes, then rely on the developer's own ability and enough testing to avoid risk.
Wonderful problem: Spring+mybaits Project suddenly appeared some of the mapper classes could not find