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

Caused by: java.net.UnknownHostException: ${dubbo.registry.address.id} dubbo的xml占位符解析失败 dubbo从2.6.2升级到2.7.3出现 #4835

Closed
fengjianjun1 opened this issue Aug 15, 2019 · 10 comments

Comments

@fengjianjun1
Copy link

dubbo 从2.6.2 升级到2.7.3之后,出现问题,dubbo的xml中占位符配置的数据无法解析,被认定为字符串

application.yml 中配置 dubbo.registry.address.id: zookeeper://127.0.0.1:2181

@SpringBootApplication
@EnableDubbo
@ImportResource("classpath:consumer.xml")
public class Application

consumer.xml 中配置 <dubbo:registry address="${dubbo.registry.address.id}" default="false" id="idserver" />

怀疑是spring 的初始化尚未结束,dubbo就开始读取配置文件中的信息,导致占位符失效

@tswstarplanet
Copy link
Contributor

这个问题我在dubbo-spring-boot-project里提了个pr

@JsonSong89
Copy link

同样发现这个问题了 现在有解决方案吗?

@fengjianjun1
Copy link
Author

这个问题我在dubbo-spring-boot-project里提了个pr

我看到了这个pr 不过这个pr审核没通过么?说明2.7.3目前确实存在这个问题是么?

@kaori-seasons
Copy link
Contributor

kaori-seasons commented Aug 15, 2019

可以考虑先在这里配个环境变量试试
index

@tswstarplanet
Copy link
Contributor

这个问题我在dubbo-spring-boot-project里提了个pr

我看到了这个pr 不过这个pr审核没通过么?说明2.7.3目前确实存在这个问题是么?

ci passed

@fengjianjun1
Copy link
Author

可以考虑先在这里配个环境变量试试
index
image

并没有生效

@fengjianjun1
Copy link
Author

fengjianjun1 commented Aug 16, 2019

这个问题我在dubbo-spring-boot-project里提了个pr

我看到了这个pr 不过这个pr审核没通过么?说明2.7.3目前确实存在这个问题是么?

ci passed

我看到你的提交记录了,按照你的修改,把源码DubboUtils 中修改了一下,然后启动项目,结果依然是失败
image

@tswstarplanet
Copy link
Contributor

@fengjianjun1 你再试下,之前那个有点问题,我后来修改过了

@Dong-2017
Copy link

我也遇到这个问题,临时用apollo外部配置覆盖dubbo config

@CrazyHZM
Copy link
Member

Try it with the latest version, if you still have problems, you can reopen the issues

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

6 participants