nacos作为注册中心,客户端进行泛化调用,出现No provider available ,通过注册zookeeper进行调用正常。
客户端调用的代码
ReferenceConfig referenceConfig=new ReferenceConfig<>();
referenceConfig.setGeneric(true);
referenceConfig.setApplication(new ApplicationConfig("first-dubbo-consumer"));
RegistryConfig registryConfig=new RegistryConfig();
registryConfig.setAddress("nacos://127.0.0.1:8848?namespace=e2c211bc-df7b-42d9-834b-12b8d2e9bb0e");
HashMap<String,String> map=new HashMap<>();
map.put("namespace","e2c211bc-df7b-42d9-834b-12b8d2e9bb0e");
registryConfig.setParameters(map);
referenceConfig.setRegistry(registryConfig);
referenceConfig.setInterface("org.apache.dubbo.samples.api.GreetingService");
ReferenceConfigCache configCache=ReferenceConfigCache.getCache();
GenericService genericService = configCache.get(referenceConfig);
Object result = genericService.$invoke("sayHello", new String[]{"java.lang.String"}, new Object[]{"world"});
Environment
- Dubbo version: 2.7.5
- Operating System version: window10
- Java version: 1.8
Steps to reproduce this issue
Pls. provide [GitHub address] to reproduce this issue.
Expected Result
正常调用到服务端的方法
Actual Result
发生异常,异常信息
Exception in thread "main" java.lang.IllegalStateException: Failed to check the status of the service org.apache.dubbo.samples.api.GreetingService. No provider available for the service org.apache.dubbo.samples.api.GreetingService from the url nacos://127.0.0.1:8848/org.apache.dubbo.registry.RegistryService?application=first-dubbo-consumer&dubbo=2.0.2&generic=true&interface=org.apache.dubbo.samples.api.GreetingService&pid=16936®ister.ip=192.168.xx.xxx&release=2.7.5&side=consumer&sticky=false×tamp=1584787132860 to the consumer 192.168.xx.xxx use dubbo version 2.7.5
请求帮忙解答,thanks!
nacos作为注册中心,客户端进行泛化调用,出现No provider available ,通过注册zookeeper进行调用正常。
客户端调用的代码
ReferenceConfig referenceConfig=new ReferenceConfig<>();
referenceConfig.setGeneric(true);
referenceConfig.setApplication(new ApplicationConfig("first-dubbo-consumer"));
RegistryConfig registryConfig=new RegistryConfig();
registryConfig.setAddress("nacos://127.0.0.1:8848?namespace=e2c211bc-df7b-42d9-834b-12b8d2e9bb0e");
HashMap<String,String> map=new HashMap<>();
map.put("namespace","e2c211bc-df7b-42d9-834b-12b8d2e9bb0e");
registryConfig.setParameters(map);
referenceConfig.setRegistry(registryConfig);
referenceConfig.setInterface("org.apache.dubbo.samples.api.GreetingService");
Environment
Steps to reproduce this issue
Pls. provide [GitHub address] to reproduce this issue.
Expected Result
正常调用到服务端的方法
Actual Result
发生异常,异常信息
Exception in thread "main" java.lang.IllegalStateException: Failed to check the status of the service org.apache.dubbo.samples.api.GreetingService. No provider available for the service org.apache.dubbo.samples.api.GreetingService from the url nacos://127.0.0.1:8848/org.apache.dubbo.registry.RegistryService?application=first-dubbo-consumer&dubbo=2.0.2&generic=true&interface=org.apache.dubbo.samples.api.GreetingService&pid=16936®ister.ip=192.168.xx.xxx&release=2.7.5&side=consumer&sticky=false×tamp=1584787132860 to the consumer 192.168.xx.xxx use dubbo version 2.7.5
请求帮忙解答,thanks!