You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@dubbo.apache.org by "IronCity (GitHub)" <gi...@apache.org> on 2019/04/04 09:16:20 UTC

[GitHub] [incubator-dubbo-spring-boot-project] IronCity opened issue #484: DubboConfigConfigurationRegistrar do registerBeans Bindings

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


[GitHub] [incubator-dubbo-spring-boot-project] mercyblitz commented on issue #484: when DubboConfigConfigurationRegistrar do registerBeans have unreasonable use

Posted by "mercyblitz (GitHub)" <gi...@apache.org>.
@see https://github.com/apache/incubator-dubbo/issues/3193

[ 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


[GitHub] [incubator-dubbo-spring-boot-project] mercyblitz closed issue #484: when DubboConfigConfigurationRegistrar do registerBeans have unreasonable use

Posted by "mercyblitz (GitHub)" <gi...@apache.org>.
[ issue closed by mercyblitz ]

[ 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