liufeiyu1002 commented on PR #10451:
URL: https://github.com/apache/dubbo/pull/10451#issuecomment-1214185531

   
![image](https://user-images.githubusercontent.com/32605119/184501797-335832a7-8c48-4dbc-8d21-e452cf0a9ec9.png)
   1. `sofa application` 容器启动时 调用`SofaModuleBeanFactoryPostProcessor `执行 
`postProcessBeanFactory `方法 会把当前 容器中`BeanFactoryPostProcessor ` 
`BeanPostProcessor `类型的 `BeanDefinition `都注册存储到  
`PROCESSORS_OF_ROOT_APPLICATION_CONTEXT  `中,此时 
`ReferenceAnnotationBeanPostProcessor` 已经被从当前容器中移除 `BeanDefinition `实例也同时销毁 
,但是`DubboInfraBeanRegisterPostProcessor` 类型的 `BeanDefinition ` 被加入了
   
![image](https://user-images.githubusercontent.com/32605119/184502386-32467a7a-9db9-4718-afcb-9dbf454919bd.png)
   2. 在 sofa 子模块容器启动时 创建子容器以后 会从父容器中获取`PROCESSORS_OF_ROOT_APPLICATION_CONTEXT 
`类,获取 到 `DubboInfraBeanRegisterPostProcessor` 注册到子容器中,在执行到 
beanFactoryPostProcessor 方法时 从容器中获取 `ReferenceAnnotationBeanPostProcessor` 
bean的时候  子容器中 并没有 `ReferenceAnnotationBeanPostProcessor` 
对应的实例和相关的`BeanDefinition ` 父容器中也没有 所以会抛出异常。
   
![image](https://user-images.githubusercontent.com/32605119/184502487-44a49c93-c80c-43c1-af37-cc89b38481ba.png)
   


-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to