报错说明1:
org.apache.ibatis.binding.BindingException: Type interface com.jt.mapper.DemoUserMapper is not known to the MapperRegistry.
解决方案:检查.xml映射文件中namespace的值,是否与mapper层中的接口一致
报错说明2:
org.apache.ibatis.binding.BindingException: Invalid bound statement (not found): com.jt.mapper.DemoUserMapper.findAll
解决方案:检查.xml映射文件中id的值,是否与mapper层中的接口的方法名一致
报错说明3:
org.apache.ibatis.exceptions.PersistenceException:
### Error building SqlSession.
### The error may exist in mybatis\mappers\DemoUserMapper.xml
### Cause: org.apache.ibatis.builder.BuilderException: Error parsing SQL Mapper Configuration. Cause: org.apache.ibatis.builder.BuilderException: Error parsing Mapper XML. The XML location is 'mybatis\mappers\DemoUserMapper.xml'. Cause: org.apache.ibatis.builder.BuilderException: Error resolving class. Cause: org.apache.ibatis.type.TypeException: Could not resolve type alias 'com.jt.pojo.DemoUserp'. Cause: java.lang.ClassNotFoundException: Cannot find class: com.jt.pojo.DemoUserp
解决方案:检查.xml映射文件中resultType的值,是否与实体对象路径一致
报错说明4:
org.apache.ibatis.exceptions.PersistenceException:
### Error building SqlSession.
### The error may exist in mybatis\mappers\DemoUserMapperh.xml
### Cause: org.apache.ibatis.builder.BuilderException: Error parsing SQL Mapper Configuration. Cause: java.io.IOException: Could not find resource mybatis\mappers\DemoUserMapperh.xml
解决方案:检查mybatis核心配置文件中加载映射文件的路径是否正确
————————————————
版权声明:本文为CSDN博主「wyk8516」的原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接及本声明。
原文链接:https://blog.csdn.net/wyk8516/article/details/120460767
4.检查@MapperScan(“com.jt.mapper”)
2.6.2 数据库链接异常
报错说明: 数据库链接异常
检查数据库链接地址/用户名/密码