2019-04-18 23:49:30.136 WARN 10140 --- [ main] ConfigServletWebServerApplicationContext : Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'eurekaClientConfigBean': Unsatisfied dependency expressed through field 'propertyResolver'; nested exception is org.springframework.beans.factory.NoUniqueBeanDefinitionException: No qualifying bean of type 'org.springframework.core.env.PropertyResolver' available: expected single matching bean but found 2: dubboScanBasePackagesPropertyResolver,environment
2019-04-18 23:49:30.137 INFO 10140 --- [ main] o.s.s.concurrent.ThreadPoolTaskExecutor : Shutting down ExecutorService 'applicationTaskExecutor'
2019-04-18 23:49:30.139 INFO 10140 --- [ main] f.a.ReferenceAnnotationBeanPostProcessor : org.apache.dubbo.common.bytecode.proxy0@2eada095 was destroying!
2019-04-18 23:49:30.139 INFO 10140 --- [ main] f.a.ReferenceAnnotationBeanPostProcessor : class org.apache.dubbo.config.spring.beans.factory.annotation.ReferenceAnnotationBeanPostProcessor was destroying!
2019-04-18 23:49:30.140 INFO 10140 --- [ main] o.apache.catalina.core.StandardService : Stopping service [Tomcat]
2019-04-18 23:49:30.154 INFO 10140 --- [ main] ConditionEvaluationReportLoggingListener :
Error starting ApplicationContext. To display the conditions report re-run your application with 'debug' enabled.
2019-04-18 23:49:30.155 INFO 10140 --- [ main] .b.c.e.AwaitingNonWebApplicationListener : [Dubbo] Current Spring Boot Application is about to shutdown...
2019-04-18 23:49:30.159 ERROR 10140 --- [ main] o.s.b.d.LoggingFailureAnalysisReporter :
***************************
APPLICATION FAILED TO START
***************************
Description:
Field propertyResolver in org.springframework.cloud.netflix.eureka.EurekaClientConfigBean required a single bean, but 2 were found:
- dubboScanBasePackagesPropertyResolver: defined by method 'dubboScanBasePackagesPropertyResolver' in class path resource [org/apache/dubbo/spring/boot/autoconfigure/DubboRelaxedBinding2AutoConfiguration.class]
- environment: a programmatically registered singleton
Action:
Consider marking one of the beans as @Primary, updating the consumer to accept multiple beans, or using @Qualifier to identify the bean that should be consumed
Process finished with exit code 1
开发环境
引用包
问题描述
Spring Boot 项目,使用 Dubbo 和 Eureka ,启动项目时报错。
报错信息
是哪里的问题呢?如何解决?