You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Pls. provide [GitHub address] to reproduce this issue.
Expected Result
What do you expected from the above steps?
应该正确获取到配置文件中指定的Namespace值,在本场景中为TEST1.dubbo
Actual Result
未能正确获取,而是变成了默认的dubbo
What actually happens?
If there is an exception, please attach the exception trace:
2020-08-16 23:34:37.645 ERROR 3752 --- [ main] o.s.boot.SpringApplication : Application run failed
java.lang.IllegalStateException: Failed to connect to config center, the config center is Apollo, the address is: http://xxx:8080
at org.apache.dubbo.configcenter.support.apollo.ApolloDynamicConfiguration.<init>(ApolloDynamicConfiguration.java:109) ~[dubbo-2.7.8.jar:2.7.8]
at org.apache.dubbo.configcenter.support.apollo.ApolloDynamicConfigurationFactory.createDynamicConfiguration(ApolloDynamicConfigurationFactory.java:29) ~[dubbo-2.7.8.jar:2.7.8]
at org.apache.dubbo.common.config.configcenter.AbstractDynamicConfigurationFactory.lambda$getDynamicConfiguration$0(AbstractDynamicConfigurationFactory.java:39) ~[dubbo-2.7.8.jar:2.7.8]
at java.base/java.util.concurrent.ConcurrentHashMap.computeIfAbsent(ConcurrentHashMap.java:1708) ~[na:na]
at org.apache.dubbo.common.config.configcenter.AbstractDynamicConfigurationFactory.getDynamicConfiguration(AbstractDynamicConfigurationFactory.java:39) ~[dubbo-2.7.8.jar:2.7.8]
at org.apache.dubbo.common.config.configcenter.DynamicConfiguration.getDynamicConfiguration(DynamicConfiguration.java:224) ~[dubbo-2.7.8.jar:2.7.8]
at org.apache.dubbo.config.bootstrap.DubboBootstrap.prepareEnvironment(DubboBootstrap.java:1034) ~[dubbo-2.7.8.jar:2.7.8]
at org.apache.dubbo.config.bootstrap.DubboBootstrap.startConfigCenter(DubboBootstrap.java:623) ~[dubbo-2.7.8.jar:2.7.8]
at org.apache.dubbo.config.bootstrap.DubboBootstrap.initialize(DubboBootstrap.java:521) ~[dubbo-2.7.8.jar:2.7.8]
at org.apache.dubbo.config.bootstrap.DubboBootstrap.start(DubboBootstrap.java:896) ~[dubbo-2.7.8.jar:2.7.8]
at org.apache.dubbo.config.spring.context.DubboBootstrapApplicationListener.onContextRefreshedEvent(DubboBootstrapApplicationListener.java:59) ~[dubbo-2.7.8.jar:2.7.8]
at org.apache.dubbo.config.spring.context.DubboBootstrapApplicationListener.onApplicationContextEvent(DubboBootstrapApplicationListener.java:52) ~[dubbo-2.7.8.jar:2.7.8]
at org.apache.dubbo.config.spring.context.OneTimeExecutionApplicationContextEventListener.onApplicationEvent(OneTimeExecutionApplicationContextEventListener.java:40) ~[dubbo-2.7.8.jar:2.7.8]
at org.springframework.context.event.SimpleApplicationEventMulticaster.doInvokeListener(SimpleApplicationEventMulticaster.java:172) ~[spring-context-5.1.8.RELEASE.jar:5.1.8.RELEASE]
at org.springframework.context.event.SimpleApplicationEventMulticaster.invokeListener(SimpleApplicationEventMulticaster.java:165) ~[spring-context-5.1.8.RELEASE.jar:5.1.8.RELEASE]
at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:139) ~[spring-context-5.1.8.RELEASE.jar:5.1.8.RELEASE]
at org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:402) ~[spring-context-5.1.8.RELEASE.jar:5.1.8.RELEASE]
at org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:359) ~[spring-context-5.1.8.RELEASE.jar:5.1.8.RELEASE]
at org.springframework.context.support.AbstractApplicationContext.finishRefresh(AbstractApplicationContext.java:896) ~[spring-context-5.1.8.RELEASE.jar:5.1.8.RELEASE]
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:552) ~[spring-context-5.1.8.RELEASE.jar:5.1.8.RELEASE]
at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:742) ~[spring-boot-2.1.6.RELEASE.jar:2.1.6.RELEASE]
at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:389) ~[spring-boot-2.1.6.RELEASE.jar:2.1.6.RELEASE]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:311) ~[spring-boot-2.1.6.RELEASE.jar:2.1.6.RELEASE]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1213) ~[spring-boot-2.1.6.RELEASE.jar:2.1.6.RELEASE]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1202) ~[spring-boot-2.1.6.RELEASE.jar:2.1.6.RELEASE]
at com.sf.dubbo.bootstrap.providerApplication.main(providerApplication.java:28) ~[classes/:na]
Environment
Steps to reproduce this issue
Pls. provide [GitHub address] to reproduce this issue.
Expected Result
What do you expected from the above steps?
应该正确获取到配置文件中指定的Namespace值,在本场景中为
TEST1.dubbo
Actual Result
未能正确获取,而是变成了默认的
dubbo
What actually happens?
If there is an exception, please attach the exception trace:
查看源码和调式发现:
dubbo/dubbo-configcenter/dubbo-configcenter-apollo/src/main/java/org/apache/dubbo/configcenter/support/apollo/ApolloDynamicConfiguration.java
Lines 99 to 102 in 0be2a1b
这里截取的ParameterKey 不对,这里获取的是
config.namespace
,而在url内部的Parameter实际为namesapce
,导致获取为空,由于给了默认值下面的语句判空也没有发挥任何作用,appConfigFile的值也未能正确获取到。The text was updated successfully, but these errors were encountered: