记录:non-compatible bean definition of same name and class [com.XXX.XXX]

来源:互联网 发布:霍华德站立摸高数据 编辑:程序博客网 时间:2024/06/03 13:36


启动 springBoot 工程时报错: Caused by: org.springframework.context.annotation.ConflictingBeanDefinitionException: Annotation-specified bean name 'userLogAspect' for bean class [com.foreveross.security.config.UserLogAspect] conflicts with existing, non-compatible bean definition of same name and class [com.config.UserLogAspect]



      两个maven工程一个作为服务提供方,一个作为消费方。

引用提供方提供的RPC接口:

  <!-- 引用的服务,那个interface一定是一个被引入到DUBBO仓库的接口定义,
注意check=false,表示zookeeper不检查提供者是否存在 protocol="dubbo" 对于双协议只使用声明的协议-->    <dubbo:reference interface="com.foreveross.security.service.rpc.api.UserLogService" id="myUserLogService" protocol="dubbo" group="xmlConfig" check="false" />

在pom.xml中导入服务提供方工程,问题出在 提供方工程中已有一个 UserLogAspect  类,消费方工程中也恰恰有这样一个同名的类。

所以报错 class  已存在,重复。


去掉任意一方的这个类,或者改名就行了。

阅读全文
1 0