概述
一、 问题
Caused by: org.springframework.context.annotation.ConflictingBeanDefinitionException: Annotation-specified bean name ‘remoteLiftRodHttpService’ for bean class [com.tiandy.easy7.third.part.device.adapter.vehicle.gate.dr.service.impl.RemoteLiftRodHttpService] conflicts with existing, non-compatible bean definition of same name and class [com.tiandy.easy7.third.part.device.adapter.vehicle.gate.bluecard.service.impl.RemoteLiftRodHttpService]
二、 原因
SpringMVC中所有的bean(例如@controll,@service,@Component 等注解的类)都是应该是采用类似键值对(key/value)的映射方式处理的。而当中的键,默认是用bean类名(非全类名)作为键。这样,如果不同包下面的两个bean 重名的话,就会导致SpringMVC的容器管理中的 map中的key重复了。
三、解决
修改类名
最后
以上就是无心火龙果为你收集整理的conflicts with existing, non-compatible bean definition of same name and class的全部内容,希望文章能够帮你解决conflicts with existing, non-compatible bean definition of same name and class所遇到的程序开发问题。
如果觉得靠谱客网站的内容还不错,欢迎将靠谱客网站推荐给程序员好友。
发表评论 取消回复