Skip to content
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

dubbo 2.7.4.1 版本dubbo-demo 运行报错,无法初始化配置器 #5364

Closed
2 tasks
hzhxxx opened this issue Nov 20, 2019 · 3 comments
Closed
2 tasks

dubbo 2.7.4.1 版本dubbo-demo 运行报错,无法初始化配置器 #5364

hzhxxx opened this issue Nov 20, 2019 · 3 comments

Comments

@hzhxxx
Copy link

hzhxxx commented Nov 20, 2019

  • I have searched the issues of this repository and believe that this is not a duplicate.
  • I have checked the FAQ of this repository and believe that this is not a duplicate.

Environment

  • Dubbo version: 2.7.4
  • Operating System version: win 10
  • Java version: jdk 8u22

Steps to reproduce this issue

dubbo 2.7.4 版本dubbo-demo 运行报错,无法初始化配置器

  1. 运行 dubbo-demo-api-provider,使用 zookeeper 3.5,已经确认zk 正常。
    service.setRegistry(new RegistryConfig("zookeeper://192.168.1.203:2181"));
    运行报错,错误位于 AbstractInterfaceConfig::useRegistryForConfigIfNecessary
    的 628 行
    cc.getParameters().put(org.apache.dubbo.remoting.Constants.CLIENT_KEY,rc.getClient());
    提示 rc.getClient() 为空

  2. 使用 nacos 正常,修改代码,编译运行正常
    service.setRegistry(new RegistryConfig("nacos://192.168.1.207:8848"));

  3. dubbo-demo-xml-provider 也是相同的错误

Pls. provide [GitHub address] to reproduce this issue.

Expected Result

What do you expected from the above steps?

Actual Result

What actually happens?

If there is an exception, please attach the exception trace:

Just put your stack trace here!
Exception in thread "main" java.lang.NullPointerException
	at org.apache.dubbo.config.AbstractInterfaceConfig.lambda$null$7(AbstractInterfaceConfig.java:628)
	at java.util.Optional.orElseGet(Optional.java:267)
@hzhxxx hzhxxx changed the title dubbo 2.7.4 版本dubbo-demo 运行报错,无法初始化配置器 dubbo 2.7.4.1 版本dubbo-demo 运行报错,无法初始化配置器 Nov 20, 2019
@lkj41110
Copy link
Contributor

lkj41110 commented Nov 22, 2019

#5219 ,it was fixed in 2.7.4.1 . You can try it.

@yangzhi666
Copy link

image
是由于demo中没有初始化这个map造成的。
估计是nacos的模式下,会从注册中心取回信息,从而初始化。
这个被开发人员落下了。。。。。

@chickenlj
Copy link
Contributor

Please try 2.7.4.1 or later version.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants