-
Notifications
You must be signed in to change notification settings - Fork 310
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
友情提示,nacos-spring-context仅支持spring 3.2.18及以上版本 #153
Comments
Thank you for your care |
setBeanFactory方法是正常被invoke的,所以可以这样变现的解决environment属性为null的问题。 不过spring 3.2.5下面还会有其他的问题,由于依赖了alibaba的spring-context-support包, |
Great Job~ You'd better to update Spring framework to be 4.0 and above~ |
spring-context-support version is old, dubbo 2.7.6 this version 1.0.6 |
Updated in the new version. |
@Import(NacosConfigBeanDefinitionRegistrar.class)
在NacosConfigBeanDefinitionRegistrar中实现了EnvironmentAware接口,需要调用setEnvironment方法获取到spring 抽象的环境信息。这个在nacos-spring-context项目官方提供的例子中是OK的,例子中使用的是3.2.18版本。
但是,在我们旧项目使用的spring 3.2.5版本(由于种种原因不能轻易升级spring版本),在debug过程中发现setEnvironment方法不会被调用的,所以会导致registerBeanDefinitions方法往下执行会最终引发NPE...
通过debug和对比spring 3.2.5和spring3.2.18的源代码,发现了一些差异和造成该问题的原因
The text was updated successfully, but these errors were encountered: