iUserService注入失败

来源:6-9 用户模块所有功能自测试

希望wishes

2019-09-09

注入失败,请问是什么原因呢图片描述图片描述这两个都配置了扫描的包,请问以哪个为准呢?其中appicationContext.xml调用了applicationContext-datasource.xml

写回答

1回答

geelylucky

2019-09-10

两个都会被扫描,把报错信息提上来。

0
1
希望wishes
2019-09-10 09:52:35,630 ERROR [org.springframework.web.context.ContextLoader] - Context initialization failed org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'iUserService': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: private com.hope.dao.UserMapper com.hope.service.impl.UserServiceImpl.userMapper; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'userMapper' defined in file [E:\JavaWebSpace\mmall\target\mmall\WEB-INF\classes\com\hope\dao\UserMapper.class]: Unsatisfied dependency expressed through bean property 'sqlSessionFactory': : Error creating bean with name 'sqlSessionFactory' defined in class path resource [applicationContext-datasource.xml]: Invocation of init method failed;
2019-09-10
共1条回复

从0开始 独立完成企业级Java电商网站服务端开发

前后端分离,数据库接口设计,架构设计,功能开发,上线运维

9476 学习 · 8804 问题

查看课程