org.springframework.beans.factory.NoUniqueBeanDefinitionException异常问题
来源:互联网 发布:sleep as android 知乎 编辑:程序博客网 时间:2024/05/20 22:02
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'menuController': Injection of resource dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException:Error creating bean with name 'userService': Injection of resource dependencies failed; nested exception is org.springframework.beans.factory.NoUniqueBeanDefinitionException: No qualifying bean of type [com.xbsj.web.common.BaseMapper] is defined: expected single matching bean but found 2: baseMapper,userMapper今天在写mybatis通用dao和service的时候,出现了这个异常,最后各种修改代码,各种删方法,删继承,最后把错误点定位到了写的通用baseServiceImpl和userServiceImpl上,出现异常的原因就是因为在baseServiceImpl的baseMapper我用了@Resource注解,而在userServiceImpl的userMapper也用了@Resource注解,所以,在项目初始化的时候,就会同时创建两个mapper,抛出异常。解决方法是在baseServiceImpl中给baseMapper提供一个setter方法,在userServiceImpl重写这个方法,supper.baseMapper=userMapper
0 0
- org.springframework.beans.factory.NoUniqueBeanDefinitionException异常问题
- Cause:org.springframework.beans.factory.NoUniqueBeanDefinitionException
- Spring报错:org.springframework.beans.factory.NoUniqueBeanDefinitionException
- Exception in thread "main" org.springframework.beans.factory.NoUniqueBeanDefinitionException: No qua
- 异常处理 org.springframework.beans.factory.BeanCreationException
- 异常:org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor
- 异常org.springframework.beans.factory.NoSuchBeanDefinitionException
- org.springframework.beans.factory.BeanCreationException异常
- org.springframework.beans.factory.NoSuchBeanDefinitionException: 异常处理
- org.springframework.beans.factory.UnsatisfiedDependencyException异常
- org.springframework.beans.factory.UnsatisfiedDependencyException异常
- 异常:org.springframework.beans.factory.BeanNotOfRequiredTypeException
- org.springframework.beans.factory.BeanDefinitionStoreException异常处理
- spring异常org.springframework.beans.factory.NoSuchBeanDefinitionException
- 异常org.springframework.beans.factory.UnsatisfiedDependencyException
- SpringMVC 问题 org.springframework.beans.factory.BeanDefinitionStoreException
- 关于spring中出现org.springframework.beans.factory.BeanCreationException异常的问题
- 关于Spring中org.springframework.beans.factory.UnsatisfiedDependencyException异常
- 特殊MAC地址--官方保留
- 程序员的那些搞笑牛逼注释
- QT线程(一):线程类
- Android WebView JS和java交互
- 谷歌发布adb-fastboot工具独立包
- org.springframework.beans.factory.NoUniqueBeanDefinitionException异常问题
- Xpose模块抓取函数功能学习笔记
- html css样式绘制向下或者向上箭头
- 还有三分钟下班
- QT线程(二)---线程同步
- swift-3.0 将HexColor转变为UIColor的方法
- 解决hive表注释乱码
- windows mysql5.7 安装+主从复制
- 引用的基础知识