dubbo-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From IronCity (GitHub) <git...@apache.org>
Subject [GitHub] [incubator-dubbo-spring-boot-project] IronCity opened issue #484: DubboConfigConfigurationRegistrar do registerBeans Bindings
Date Thu, 04 Apr 2019 09:16:20 GMT
The problem happened in 
dubbo-spring-boot-project branch 2.7.x
dubbo 2.7.1

class : DubboConfigConfigurationRegistrar
```java
        // Single Config Bindings
        registerBeans(registry, DubboConfigConfiguration.Single.class);

        if (multiple) { // Since 2.6.6 https://github.com/apache/incubator-dubbo/issues/3193
            registerBeans(registry, DubboConfigConfiguration.Multiple.class);
        }
```
I found class DubboAutoConfiguration default Multiple, 
```java
    @ConditionalOnProperty(prefix = DUBBO_CONFIG_PREFIX, name = MULTIPLE_CONFIG_PROPERTY_NAME,
matchIfMissing = true)
    @EnableDubboConfig(multiple = true)
    protected static class MultipleDubboConfigConfiguration {
    }
```
when matchIfMissing = true, MultipleDubboConfigConfiguration will run, will error by spring
```txt
Invalid bean definition with name 'dubboConfigConfiguration.Multiple' defined in null: Cannot
register bean definition [Generic bean: class [org.apache.dubbo.config.spring.context.annotation.DubboConfigConfiguration$Multiple];
scope=singleton; abstract=false; lazyInit=false; autowireMode=0; dependencyCheck=0; autowireCandidate=true;
primary=false; factoryBeanName=null; factoryMethodName=null; initMethodName=null; destroyMethodName=null]
for bean 'dubboConfigConfiguration.Multiple': There is already [Generic bean: class [org.apache.dubbo.config.spring.context.annotation.DubboConfigConfiguration$Multiple];
scope=singleton; abstract=false; lazyInit=false; autowireMode=0; dependencyCheck=0; autowireCandidate=true;
primary=false; factoryBeanName=null; factoryMethodName=null; initMethodName=null; destroyMethodName=null]
bound.
```
but dubbo 2.7.0 is difference, it will not happen,  code as following  shows
```java
        if (multiple) { //true
            registerBeans(registry, DubboConfigConfiguration.Multiple.class);
        } else {
            registerBeans(registry, DubboConfigConfiguration.Single.class);
        }
```
I want to use dubbo 2.7.1 and dubbo-spring-boot-project 2.7.x, I hope not need to  add config

```xml
dubbo.config.multiple=false
```





[ Full content available at: https://github.com/apache/incubator-dubbo-spring-boot-project/issues/484
]
This message was relayed via gitbox.apache.org for notifications@dubbo.apache.org


Mime
View raw message