数据库
首页 > 数据库> > Error creating bean with name ‘sqlSessionFactory‘ defined in class path resource

Error creating bean with name ‘sqlSessionFactory‘ defined in class path resource

作者:互联网

整合SSM时遇到的错误
org.springframework.beans.factory.BeanCreationException: Error creating bean with name ‘sqlSessionFactory’ defined in class path resource [spring-dao.xml]: Invocation of init method failed; nested exception is org.springframework.core.NestedIOException: Failed to parse mapping resource: ‘class path resource [com/kuang/mapper/UserMapper.xml]’; nested exception is org.apache.ibatis.builder.BuilderException: Error parsing Mapper XML. The XML location is ‘class path resource [com/kuang/mapper/UserMapper.xml]’. Cause: java.lang.IllegalArgumentException: Mapped Statements collection already contains value for com.kuang.mapper.UserMapper.selectUser. please check com/kuang/mapper/UserMapper.xml and class path resource [com/kuang/mapper/UserMapper.xml]

在这里插入图片描述原因:
在这里插入图片描述

多写了一份这个东西
在这里插入图片描述跟Spring里面的冲突了
删掉,编译成功
在这里插入图片描述

标签:xml,mapper,sqlSessionFactory,resource,creating,UserMapper,path,class
来源: https://blog.csdn.net/xunxiang_/article/details/121280662