大佬们这是什么错

qq_36770250 2017-11-16 12:21:52
严重: Exception sending context initialized event to listener instance of class org.springframework.web.context.ContextLoaderListener
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'loginController': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: private com.coder520.user.service.UserService com.coder520.login.controller.LoginController.userService; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'UserServiceImpl': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: private com.coder520.user.dao.UserMapper com.coder520.user.service.UserServiceImpl.userMapper; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type [com.coder520.user.dao.UserMapper] found for dependency: expected at least 1 bean which qualifies as autowire candidate for this dependency. Dependency annotations: {@org.springframework.beans.factory.annotation.Autowired(required=true)}
Related cause: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'userMapper' defined in file [E:\idea\项目\work-attendance\target\coder520\WEB-INF\classes\com\coder520\user\dao\UserMapper.class]: Cannot resolve reference to bean 'sqlSessionFactory' while setting bean property 'sqlSessionFactory'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sqlSessionFactory' defined in class path resource [spring-cfg.xml]: Invocation of init method failed; nested exception is org.springframework.core.NestedIOException: Failed to parse mapping resource: 'file [E:\idea\项目\work-attendance\target\coder520\WEB-INF\classes\com\coder520\user\dao\UserMapper.xml]'; nested exception is org.apache.ibatis.builder.BuilderException: Error parsing Mapper XML. Cause: java.lang.IllegalArgumentException: Result Maps collection already contains value for com.coder520.user.dao.UserMapper.BaseResultMap
Related cause: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'userMapper' defined in file [E:\idea\项目\work-attendance\target\coder520\WEB-INF\classes\com\coder520\user\dao\UserMapper.class]: Cannot resolve reference to bean 'sqlSessionFactory' while setting bean property 'sqlSessionFactory'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sqlSessionFactory' defined in class path resource [spring-cfg.xml]: Invocation of init method failed; nested exception is org.springframework.core.NestedIOException: Failed to parse mapping resource: 'file [E:\idea\项目\work-attendance\target\coder520\WEB-INF\classes\com\coder520\user\dao\UserMapper.xml]'; nested exception is org.apache.ibatis.builder.BuilderException: Error parsing Mapper XML. Cause: java.lang.IllegalArgumentException: Result Maps collection already contains value for com.coder520.user.dao.UserMapper.BaseResultMap
at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessPropertyValues
...全文
273 4 打赏 收藏 转发到动态 举报
写回复
用AI写文章
4 条回复
切换为时间正序
请发表友善的回复…
发表回复
代码间的舞者 2017-11-18
  • 打赏
  • 举报
回复
数据库没有配置好,或者数据库没连接上
木子0204 2017-11-16
  • 打赏
  • 举报
回复
代码出问题了,从最开始报错的地方一步步的找,在错误中寻找答案才是最快的成长 ①Error creating bean with name 'loginController': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field:看看你有没有写这个@autowire在方法体上面 ②让在跟踪下面的 Related cause: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'userMapper' defined in file [E:\idea\项目\work-attendance\target\coder520\WEB- 就这样子一步步排查寻找答案
6点A君 2017-11-16
  • 打赏
  • 举报
回复
Error creating bean with name 'userMapper' defined in file [E:\idea\项目\work-attendance\target\coder520\WEB- 看这一行,一般是userMapper的节扩或者xml写的有问题
自由自在_Yu 2017-11-16
  • 打赏
  • 举报
回复
UserMapper这个配置有问题,代码贴出来

67,512

社区成员

发帖
与我相关
我的任务
社区描述
J2EE只是Java企业应用。我们需要一个跨J2SE/WEB/EJB的微容器,保护我们的业务核心组件(中间件),以延续它的生命力,而不是依赖J2SE/J2EE版本。
社区管理员
  • Java EE
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧