啟動 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 ?已存在,重復。
去掉任意一方的這個類,或者改名就行了。