You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@dubbo.apache.org by GitBox <gi...@apache.org> on 2021/07/02 03:14:15 UTC

[GitHub] [dubbo] liyong1028826685 opened a new issue #8201: 重复注册 DubboBootstrapApplicationListener

liyong1028826685 opened a new issue #8201:
URL: https://github.com/apache/dubbo/issues/8201


   
   ### Environment
   
   * Dubbo version: 2.7.8
   * Operating System version: mac
   * Java version: 1.8
   
   ### Steps to reproduce this issue
   
   1. 在应用启动过程中使用@DubboComponentScan注解
   2. @DubboComponentScan注解中@Import(DubboComponentScanRegistrar.class)
   3. org.apache.dubbo.config.spring.context.annotation.DubboComponentScanRegistrar#registerBeanDefinitions注册BeanDefinition
   4. 在org.apache.dubbo.config.spring.context.annotation.DubboComponentScanRegistrar#registerServiceAnnotationBeanPostProcessor中注册DubboBootstrapApplicationListener
   5. 紧接着在org.apache.dubbo.config.spring.util.DubboBeanUtils#registerCommonBeans中也注册了DubboBootstrapApplicationListener
   
   
   ### Expected Result
   
   这里应该只去注册一次 DubboBootstrapApplicationListener
   
   ### Actual Result
   
   注册了两次
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org


[GitHub] [dubbo] CrazyHZM closed issue #8201: 重复注册 DubboBootstrapApplicationListener

Posted by GitBox <gi...@apache.org>.
CrazyHZM closed issue #8201:
URL: https://github.com/apache/dubbo/issues/8201


   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org


[GitHub] [dubbo] CrazyHZM commented on issue #8201: 重复注册 DubboBootstrapApplicationListener

Posted by GitBox <gi...@apache.org>.
CrazyHZM commented on issue #8201:
URL: https://github.com/apache/dubbo/issues/8201#issuecomment-926430581


   There should be nothing wrong with the reply, please close the issue temporarily, and reopen the issue if there are other issues.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org


[GitHub] [dubbo] horizonzy commented on issue #8201: 重复注册 DubboBootstrapApplicationListener

Posted by GitBox <gi...@apache.org>.
horizonzy commented on issue #8201:
URL: https://github.com/apache/dubbo/issues/8201#issuecomment-873439353


   Hi, for xml config and annotation config, we need both config to invoke it.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org


[GitHub] [dubbo] kylixs commented on issue #8201: 重复注册 DubboBootstrapApplicationListener

Posted by GitBox <gi...@apache.org>.
kylixs commented on issue #8201:
URL: https://github.com/apache/dubbo/issues/8201#issuecomment-875372071


   Calling DubboBeanUtils#registerCommonBeans() multiple times will not register beans repeatedly, and do nothing if it has already been registered.
   ```java
       static boolean registerInfrastructureBean(BeanDefinitionRegistry beanDefinitionRegistry,
                                                        String beanName,
                                                        Class<?> beanType) {
   
           boolean registered = false;
   
           if (!beanDefinitionRegistry.containsBeanDefinition(beanName)) {
               RootBeanDefinition beanDefinition = new RootBeanDefinition(beanType);
               beanDefinition.setRole(BeanDefinition.ROLE_INFRASTRUCTURE);
               beanDefinitionRegistry.registerBeanDefinition(beanName, beanDefinition);
               registered = true;
   
               if (log.isDebugEnabled()) {
                   log.debug("The Infrastructure bean definition [" + beanDefinition
                           + "with name [" + beanName + "] has been registered.");
               }
           }
   
           return registered;
       }
   ```


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org