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]

conflicts with existing, non-compatible bean definition of same name and class_第1张图片

二、 原因

SpringMVC中所有的bean(例如@controll,@service,@Component 等注解的类)都是应该是采用类似键值对(key/value)的映射方式处理的。而当中的键,默认是用bean类名(非全类名)作为键。这样,如果不同包下面的两个bean 重名的话,就会导致SpringMVC的容器管理中的 map中的key重复了。

三、解决

修改类名
conflicts with existing, non-compatible bean definition of same name and class_第2张图片

你可能感兴趣的:(java,spring,spring,boot,Exception)