SSM框架遇到的错误集

java.lang.IllegalArgumentException: Result Maps collection does not contain value for com.jt.mapper.EmpMapper.dept

名字写错了

Invalid bound statement (not found): com.jt.mapper.UserMapper.findUserByNA2

xml中可能id的名字不匹配

org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'userController': Unsatisfied dependency expressed through field 'userService';
 nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'userServiceImpl': Unsatisfied dependency expressed through field
 'userMapper'; nested exception isorg.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'userMapper' defined in file 
[F:\cgb2107\springboot_ssm2\target\classes\com\jt\mapper\UserMapper.class]: Unsatisfied dependency expressed through bean property 'sqlSessionFactory'; 
nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sqlSessionFactory' defined in class path resource
 [org/mybatis/spring/boot/autoconfigure/MybatisAutoConfiguration.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.
BeanInstantiationException: Failed to instantiate [org.apache.ibatis.session.SqlSessionFactory]: Factory method 'sqlSessionFactory' threw exception; 
nested exception is org.springframework.core.NestedIOException: Failed to parse mapping resource: 'file [F:\cgb2107\springboot_ssm2\target\classes\mybatis\mappers\mybatis-config.xml]'; 
nested exception is org.apache.ibatis.builder.BuilderException: Error parsing Mapper XML. The XML location is 'file [F:\cgb2107\springboot_ssm2\target\classes\mybatis\mappers\mybatis-config.xml]'. Cause: java.lang.NullPointerException

因为配置了yml所有不用mybatis的配置文件

Invalid bound statement (not found): com.jt.mapper.UserMapper.findUserByIds
xml配置文件找不到(可能出现了名字重复的问题检查一下是否有重复的ID)

Parameter 'id' not found. Available parameters are [array, arg0]
id找不到可能是写错了


org.apache.ibatis.binding.BindingException: Type interface com.jt.mapper.UserMapper is not known to the MapperRegistry.
检查namespace命名是否与接口一致


org.apache.ibatis.binding.BindingException: Invalid bound statement (not found): com.jt.mapper.UserMapper.findAll
检查xml映射文件中的ID是否与接口方法一致.

The error may exist in mybatis/mappers/UserMapper2.xml
检查mybatis核心文件加载mapper映射文件的路径是否正确.

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

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

org.apache.ibatis.binding.BindingException: Mapper method 'com.jt.mapper.DemoUserMapper.findNames' has an unsupported return type: interface java.util.List
进行更新操作不需要返回值我给他配置了返回值

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值