Annotation-specified bean name conflicts with existing
问题说明
Annotation-specified bean name conflicts with existing,non-compatible bean definition of same name and class
翻译一下,大概就是:
使用的注解发现了2个同名的bean导致了冲突。
原因分析
我用的springboot依赖了2个第三方jar,里面分别有一个AuditConfig bean,我又不能去修改他们,因为不是我维护的。问题清楚了下面解决吧!
问题解决
既然不能去改变第三方依赖,那就尝试在我应用启动的时候排除掉那个不用的bean即可,例如我的做法:
@ComponentScan(basePackages = {"com.xx.xx.*"}, excludeFilters = @ComponentScan.Filter(type = FilterType.ASSIGNABLE_TYPE, classes = {AuditConfig.class}))
Annotation-specified bean name conflicts with existing的更多相关文章
- Annotation-specified bean name 'userDaoImpl' for bean class [***] conflicts with existing, non-compatible bean definition of same name and class [***]
使用Spring开发的时候报错如下: Caused by: org.springframework.context.annotation.ConflictingBeanDefinitionExcept ...
- SpringMVC conflicts with existing, non-compatible bean definition of same name and class 的解决办法
问题起因 最近,项目组的里的同事遇到一个问题,他自己负责的模块,SpringMVC的Controller与其他模块的Controller 类名重名了,导致整个工程都起不来了. 后台报的错误是这样的: ...
- spring 'arroudAspect' for bean class [com.dw.test.ArroudAspect] conflicts with existing, non-compatible bean definition of same name and class [com.dw.aspect.ArroudAspect]
Exception in thread "main" org.springframework.beans.factory.BeanDefinitionStoreException: ...
- Data Being Added Conflicts with Existing Data
While developing a page with multiple scrolls levels, and especially when using a grid, you may get ...
- 【spring】之xml和Annotation,Bean注入的方式
基于xml形式Bean注入 @Data @AllArgsConstructor @NoArgsConstructor public class PersonBean { private Integer ...
- JavaEE互联网轻量级框架整合开发(书籍)阅读笔记(11):XML和Annotation装配Bean的混合使用(@ImportResource)
一.XML和Annotation装配Bean如何合理使用 引入第三方资源包中类的时候,建议使用XML配置,而使用自己编写的Java类的时候,推荐使用Annotation注解配置Bean. 二.关于注解 ...
- JavaEE互联网轻量级框架整合开发(书籍)阅读笔记(10):通过注解(annotation)装配Bean之(@Configguration、@Component、@Value、@ComponentScan、@Autowired、@Primary、@Qualifier、@Bean)
一.通过注解(annotation)装配Bean 通过之前的学习,我们已经知道如何使用XML装配Bean,但是更多的时候已经不再推荐使用XML的方式去装配Bean,更多的时候会考虑注解(annotat ...
- bean名称相同冲突Annotation-specified bean name 'xx' for bean class [xxx] conflicts with existing, non-compatible bean definition of same name and class[xxx]
工程中引入其他工程的包,由于两个工程中有重名的两个bean,导致在启动时提示如下错误: 根据bean名称在ide中查找,找到这两个重名的类,可以看到由于这两个类使用@Service标注,此时如果不使用 ...
- Annotation Type @bean,@Import,@configuration使用--官方文档
@Target(value={METHOD,ANNOTATION_TYPE}) @Retention(value=RUNTIME) @Documented public @interface Bean ...
- 吴裕雄--天生自然JAVA SPRING框架开发学习笔记:Spring基于Annotation装配Bean
在 Spring 中,尽管使用 XML 配置文件可以实现 Bean 的装配工作,但如果应用中 Bean 的数量较多,会导致 XML 配置文件过于臃肿,从而给维护和升级带来一定的困难. Java 从 J ...
随机推荐
- Nginx的日志处理
Nginx的日志处理 背景 之前一直被各种咨询nginx的使用问题. 大部分都是性能, 加模块, 以及一些tcp端口等的问题. 其实这些都还好, 还有一个比较麻烦的问题时日志相关的. nginx的日志 ...
- [转帖]京东大佬细说:Nginx反向代理时保持长连接,看完直呼"学到了!"
https://mp.weixin.qq.com/s?__biz=MzU1MzE2NzIzMg==&mid=2247488405&idx=1&sn=7081ff4e0ac1de ...
- [转帖]ORACLE 并行(PARALLEL)实现方式及优先级
http://blog.itpub.net/25542870/viewspace-2120924/ 一. Parallel query 默认情况下session 是ENABLE状态 1. ...
- [转帖]Linux磁盘I/O(一):Cache,Buffer和sync
Cache和Buffer的区别 磁盘是一个块设备,可以划分为不同的分区:在分区之上再创建文件系统,挂载到某个目录,之后才可以在这个目录中读写文件.Linux 中"一切皆文件",我们 ...
- openssh 修改版本号显示
#背景介绍:G端项目经常收到相关漏洞但有时升级最新版本(8.8p)还是会有相关漏洞(CVE-2020-15778),只能禁用相关命令或修改版本号 #漏洞名称OpenSSH 命令注入漏洞(CVE-202 ...
- [1036]kvm虚拟机访问时提示no route to host分析
环境 宿主机: IP: 10.110.136.43 版本:Kylin Linux Advanced Server release V10 (Sword) KVM vm: IP: 10.110.136. ...
- [译]深入了解现代web浏览器(三)
本文是根据Mariko Kosaka在谷歌开发者网站上的系列文章https://developer.chrome.com/blog/inside-browser-part3/ 翻译而来,共有四篇,该篇 ...
- locust+python性能测试库
一.简介 locust官网介绍:Locust 是一个用于 HTTP 和其他协议的开源性能/负载测试工具.其对开发人员友好的方法允许您在常规 Python 代码中定义测试.Locust测试可以从命令行运 ...
- Flutter开发桌面应用的一些探索
引言 在移动应用开发领域,Flutter已经赢得了广泛的认可和采用,成为了跨平台移动应用开发的瑞士军刀.然而,Flutter的魅力并不仅限于移动平台,它还可以用于开发桌面应用程序,为开发人员提供了一种 ...
- 让你彻底理解Typescript中静态成员和抽象方法
1.Typescript中static详解 静态成员:在类中通过 static 修饰的属性或者方法 那么就是静态的属性静态方法 也称之为:静态成员(静态成员包含静态属性和静态方法) 静态成员在使用的时 ...