我是靠谱客的博主 无心火龙果,最近开发中收集的这篇文章主要介绍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 with existing, non-compatible bean definition of same name and class所遇到的程序开发问题。

如果觉得靠谱客网站的内容还不错,欢迎将靠谱客网站推荐给程序员好友。

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

评论列表共有 0 条评论

立即
投稿
返回
顶部