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重复了。

三、解决

修改类名
在这里插入图片描述

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值