這個報錯導致的原因有很多,以下為我遇到時一一解決方案
報錯一:跟蹤錯誤信息找到:Type interface com.xx.dorm.optmag.mapper.OptMapper is not known to the MapperRegistry.
大致意思時:該OptMapper未被注冊。
情況一
解決的方案:
找到mybatis.xml配置文件得mappers里面添加sql映射文件
<mappers>
<package name="com.xx.dorm.datummag.mapper"/>
<package name="com.xx.dorm.roommag.mapper"/>
<package name="com.xx.dorm.optmag.mapper"/>
</mappers>
再次運行成功。
情況二
使用idea工具時,可能出現xml未編譯清空,參考:xml未編譯
....續更....