zrlw commented on code in PR #15721:
URL: https://github.com/apache/dubbo/pull/15721#discussion_r2441831369
##########
dubbo-config/dubbo-config-spring/src/main/java/org/apache/dubbo/config/spring/reference/ReferenceBeanManager.java:
##########
@@ -192,6 +192,11 @@ public synchronized void initReferenceBean(ReferenceBean
referenceBean) throws E
// cache referenceConfig
referenceConfigMap.put(referenceKey, referenceConfig);
+ // add a null check for moduleModel to be compatible with the
native environment
+ if (moduleModel == null) {
+ moduleModel =
DubboBeanUtils.getModuleModel(applicationContext);
+ }
+
// register ReferenceConfig
moduleModel.getConfigManager().addReference(referenceConfig);
moduleModel.getDeployer().setPending();
Review Comment:
it might be better to call
```DubboBeanUtils.getModuleModel(applicationContext)``` at
prepareReferenceBeans method.
--
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]