转载

bug集(目前学习出现过的bug)


1 BindingException异常说明

报错说明1:

org.apache.ibatis.binding.BindingException: Type interface com.jt.mapper.UserMapper is not known to the MapperRegistry.

解决方案1:

检查namespace命名是否与接口一致

报错说明2:

org.apache.ibatis.binding.BindingException: Invalid bound statement (not found): com.jt.mapper.UserMapper.findAll

解决方案2:

检查xml映射文件中的ID是否与接口方法一致.

报错说明3:

The error may exist in mybatis/mappers/UserMapper2.xml

解决方案3:

检查mybatis核心文件加载mapper映射文件的路径是否正确.

报错说明4:

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 ‘DemoUser’. Cause: java.lang.ClassNotFoundException: Cannot find class: DemoUser

解决方案4:

问题可能是xml映射文件中的resultType的类型异常.

  • 转载自:https://blog.csdn.net/weixin_57556459/article/details/120462942
  • 留言