You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@dubbo.apache.org by "beiwei30 (GitHub)" <gi...@apache.org> on 2019/03/05 07:13:36 UTC

[GitHub] [incubator-dubbo] beiwei30 commented on issue #3476: NullPointerException happened when using SpringContainer.getContext()

> 在一个服务的具体实现类内部,我们是没法获取到ApplicationContext对象的,这个对象是main方法启动的时候才有,而且在启动过程中,它也是null,无法通过他来getbean

我的意见是,这种用法不太对,直接实现 `ApplicationContextAware` 自然而然就拿到 context 实例了。相反,我觉得 SpringContainer 上根本就不应该暴露 getContext 方法。


[ Full content available at: https://github.com/apache/incubator-dubbo/issues/3476 ]
This message was relayed via gitbox.apache.org for notifications@dubbo.apache.org