栏目分类:
子分类:
返回
名师互学网用户登录
快速导航关闭
当前搜索
当前分类
子分类
实用工具
热门搜索
名师互学网 > IT > 软件开发 > 后端开发 > Java

SSM框架遇到的错误集

Java 更新时间: 发布时间: IT归档 最新发布 模块sitemap 名妆网 法律咨询 聚返吧 英语巴士网 伯小乐 网商动力

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:cgb2107springboot_ssm2targetclassescomjtmapperUserMapper.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:cgb2107springboot_ssm2targetclassesmybatismappersmybatis-config.xml]'; 
nested exception is org.apache.ibatis.builder.BuilderException: Error parsing Mapper XML. The XML location is 'file [F:cgb2107springboot_ssm2targetclassesmybatismappersmybatis-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的类型异常.

转载请注明:文章转载自 www.mshxw.com
本文地址:https://www.mshxw.com/it/299297.html
我们一直用心在做
关于我们 文章归档 网站地图 联系我们

版权所有 (c)2021-2022 MSHXW.COM

ICP备案号:晋ICP备2021003244-6号