我是靠谱客的博主 无心火龙果,这篇文章主要介绍conflicts with existing, non-compatible bean definition of same name and class,现在分享给大家,希望可以做个参考。

一、 问题

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内容请搜索靠谱客的其他文章。

本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
点赞(67)

评论列表共有 0 条评论

立即
投稿
返回
顶部