org.springframework.beans.factory.BeanDefinitionStoreException: Failed to parse configuration class [com.clkj.dataservice.ServiceDataApplication]; nested exception is org.springframework.context.annotation.ConflictingBeanDefinitionException: Annotation-specified bean name 'pickDetailServiceImpl' for bean class [com.clkj.landservice.service.impl.PickDetailServiceImpl] conflicts with existing, non-compatible bean definition of same name and class [com.clkj.processservice.service.impl.PickDetailServiceImpl]
情景如下:
1.这是个springcloud项目,我是在一个模块中引入如其他两个模块的,因为需要用到这两个模块的service,但这两个模块中都有一个相同的service的实现类
可以加注解解决
你确定这代码没问题?既然是公共模块,又是单一bean,你干啥写两次
spring:
main:
allow-bean-definition-overriding: true