You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I found this issue has not been completely solved in version 2.7.5. The eager initialization has bean solved in this version , but placeholder is not going to work in xml. #646
使用dubbo spring boot发现,当引入xml配置时,由于xml的reference会在beanFactoryPostProcessor阶段解析生成ReferenceBean的BeanDefinition,随后当调用getBeanNamesForType方法时
DubboConfigBeanDefinitionConflictProcessor#resolveUniqueApplicationConfigBean)
会触发遍历所有的BeanNames,并执行isTypeMatch方法,在执行isTypeMatch方法时第一步会通过newInstance方式生成ReferenceBean(getSingletonFactoryBeanForTypeCheck方法),但是newInstance方式getObjectType会返回null,之后会触发ReferenceBean提前初始化(getTypeForFactoryBean方法). 当ReferenceBean初始化完成后执行afterPropertiesSet方法,在afterPropertiesSet又会提前初始化RegistryConfig等Bean(BeanFactoryUtils.beansOfTypeIncludingAncestors(applicationContext,RegistryConfig.class)),但是由于RegistryConfig等Bean是在BeanPostProcessor阶段(非BeanFactoryPostProcessor阶段)进行赋值以及参数宏替换,因此拿到的RegistryConfig要么为空(properties方式声明),要么占位符没有替换(xml方式声明),随后直接导致ReferenceBean初始化失败.
The text was updated successfully, but these errors were encountered: