码迷,mamicode.com
首页 > 其他好文 > 详细

Service对象创建失败

时间:2020-08-24 17:00:23      阅读:75      评论:0      收藏:0      [点我收藏+]

标签:field   ice   app   http   except   work   control   def   eating   

错误:
org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name ‘roleService‘: Unsatisfied dependency expressed through field ‘baseMapper‘: No qualifying bean of type [com.shsxt.base.BaseMapper] is defined: expected single matching bean but found 2: roleMapper,userRoleMapper; nested exception is org.springframework.beans.factory.NoUniqueBeanDefinitionException: No qualifying bean of type [com.shsxt.base.BaseMapper] is defined: expected single matching bean but found 2: roleMapper,userRoleMapper

错误结构

技术图片

Service对象创建失败的原因是,service和controller继承了baseservice和basecontroller,但是mapper没有继承basemapper(自己封装的三个base包都要继承 )也就缺失了basemapper对应的XML文件,导致service对象创建失败

正确的结构
技术图片

Service对象创建失败

标签:field   ice   app   http   except   work   control   def   eating   

原文地址:https://www.cnblogs.com/DemonQin/p/13552323.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!