Failed to instantiate [org.apache.ibatis.session.SqlSessionFactory]: Factory method ‘sqlSessionFacto
Mybatis异常:Failed to instantiate [org.apache.ibatis.session.SqlSessionFactory]: Factory method 'sqlSessionFactory' threw exception with message: Failed to parse mapping resource: 'file
记录一下Mybatis异常:Failed to instantiate [org.apache.ibatis.session.SqlSessionFactory]: Factory method 'sqlSessionFactory' threw exception with message: Failed to parse mapping resource: 'file [C:\Users\yzy\Desktop\jk\banyue\target\classes\mapper\roleauthority\RoauMapper.xml]'
原因很简单,就是找不到与mapper对应的mapper.xml文件
解决办法有两个
方法一:mapper路径与mapper.xml路径保持一致
这样build后文件就会在一起被识别到,路径名要保持一致
方法二:
配置文件配置mapper.xml文件路径
例如yml配置文件下
mybatis-plus:
mapper-locations: classpath*:mapper/*.xml
type-aliases-package: com.banyue.backend.pojo
开放原子开发者工作坊旨在鼓励更多人参与开源活动,与志同道合的开发者们相互交流开发经验、分享开发心得、获取前沿技术趋势。工作坊有多种形式的开发者活动,如meetup、训练营等,主打技术交流,干货满满,真诚地邀请各位开发者共同参与!
更多推荐
所有评论(0)