mybatis经常会报绑定异常,记录下以便以后查询方便。下面便是这次碰到的原因:
mapper.xml位置如下方式:
在application.yml中配置如下:
mybatis-plus:
mapper-locations: classpath:/mapper/*.xml
``
所以找不到xml文件,导致报错。修改后如下:
```bash
mybatis-plus:
mapper-locations: classpath:/mapper/cyber_threat_ip/*.xml
这样便修复异常了。
其他的可能导致出现该报错的原因比如(不完善,以后不断补充):
1) dao中的类名和mapper.xml中的id不一样,建议使用copy的方式避免报错
2) mapper.xml中的namespace没有写或者写错。
<mapper namespace="com.threatIntelligence.cyber_threat_ip.dao.ThreatTypeDao">