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-go3.1.1 调用 java server 2.6.x,提示 No provider available for the service #729

Open
liusese opened this issue Mar 18, 2024 · 0 comments

Comments

@liusese
Copy link

liusese commented Mar 18, 2024

import(
  "dubbo.apache.org/dubbo-go/v3/config"
  "dubbo.apache.org/dubbo-go/v3/config/generic"
  _ "dubbo.apache.org/dubbo-go/v3/imports"
  hessian "github.com/apache/dubbo-go-hessian2"
)
regConf := &config.RegistryConfig{
  Protocol:  "zookeeper",
  Timeout:   "3s",
  Group:     "zk_srver_admin",
  Namespace: "zk_srver",
  Address:   "xxxx:2181,xxxx1:2181,xxxx2:2181,xxx3:2181,xxxx4:2181",
  RegistryType: "interface",
}
refConf := config.ReferenceConfig{
  InterfaceName: "com.domain.test.info.api.TestQueryApi",
  Cluster:       "failover",
  Protocol:      dubbo.DUBBO,
  RegistryIDs: []string{"zk"},
  ProvidedBy:  "providers",
  Generic:     "true",
  Version:     "1.0.0",
}
rootConf := config.NewRootConfigBuilder().
  SetApplication(&config.ApplicationConfig{
	Name:  "app_name",
	Owner: "xxxx",
  }).
  AddRegistry("zk", regConf).
  Build()

if err := config.Load(config.WithRootConfig(rootConf)); err != nil {
panic(err)
}

_ = refConf.Init(rootConf)
refConf.GenericLoad("app_name")
resp, err := refConf.GetRPCService().(*generic.GenericService).Invoke(
  context.TODO(),
  "getTestInfo",
  []string{"java.util.List"},
  []hessian.Object{
	[]hessian.Object{
		map[string]hessian.Object{"testId": "testId001", "serId": "1710394936000"},
		map[string]hessian.Object{"testId": "testId002", "serId": "1710748418000"},
	},
  },
)

if err != nil {
  panic(err)
}

启动后,有三个 warn 信息

### 1

extension/registry_directory.go:60      registry directory zookeeper does not exist, make sure you have import the package, will use the default directory type.
### 2

tag/router.go:52        [tag router] invokers from previous router is empty.
### 3 error

proxy/proxy.go:212      [CallProxy] received rpc err: Failed to invoke the method $invoke. No provider available for the service dubbo://:@:/?interface=com.domain.test.info.api.TestQueryApi&group=&version=1.0.0 from registry zookeeper://xxxx:2181?registry=zookeeper&registry.group=zk_srver_admin&registry.label=true&registry.namespace=zk_server&registry.preferred=false&registry.role=0&registry.timeout=3s&registry.ttl=15m&registry.weight=0&registry.zone=&remote-client-name=dubbo.registries-zookeeper-xxx%3A2181%2Cxxxx1%3A2181%2Cxxxx2%3A2181%2Cxxxx3%3A2181%2Cxxxx4%3A2181&simplified=false on the consumer xxx.xxx.xxx.xxx using the dubbo version 3.1.1 .Please check if the providers have been started and registered.

还请大佬帮看看是什么问题呢?

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

1 participant