apache / dubbo

The java implementation of Apache Dubbo. An RPC and microservice framework.
https://dubbo.apache.org/
Apache License 2.0
40.52k stars 26.43k forks source link

okhttp3/OkHttpClient$Builder NoClassDefFoundError #12145

Closed MartinDai closed 10 months ago

MartinDai commented 1 year ago

Environment

Steps to reproduce this issue

I configured rest protocol in api to provide service use the following code

@Path("dubbo-rest")
@Consumes(MediaType.APPLICATION_JSON)
@Produces(MediaType.APPLICATION_JSON + "; " + MediaType.CHARSET_PARAMETER + "=UTF-8")
public interface FirstDubboService {

    @POST
    @Path("getDubboInfo")
    GetDubboInfoResponse getDubboInfo(GetDubboInfoRequest getDubboInfoRequest);

}

When the dubbo consumer service after some time of startup, it throw a exception.

The provider service is works normally(It can be called normally with dubbo and rest protocol)

Expected Behavior

no exception

Actual Behavior

got the following exception

java.lang.NoClassDefFoundError: okhttp3/OkHttpClient$Builder
    at org.apache.dubbo.remoting.http.restclient.OKHttpRestClient.createHttpClient(OKHttpRestClient.java:145)
    at org.apache.dubbo.remoting.http.restclient.OKHttpRestClient.<init>(OKHttpRestClient.java:46)
    at org.apache.dubbo.remoting.http.factory.impl.OkHttpClientFactory.doCreateRestClient(OkHttpClientFactory.java:34)
    at org.apache.dubbo.remoting.http.factory.AbstractHttpClientFactory.createRestClient(AbstractHttpClientFactory.java:60)
    at org.apache.dubbo.remoting.http.factory.RestClientFactory$Adaptive.createRestClient(RestClientFactory$Adaptive.java)
    at org.apache.dubbo.rpc.protocol.rest.RestProtocol.createReferenceCountedClient(RestProtocol.java:156)
    at org.apache.dubbo.rpc.protocol.rest.RestProtocol.lambda$protocolBindingRefer$1(RestProtocol.java:125)
    at java.util.concurrent.ConcurrentHashMap.computeIfAbsent(ConcurrentHashMap.java:1660)
    at org.apache.dubbo.common.utils.ConcurrentHashMapUtils.computeIfAbsent(ConcurrentHashMapUtils.java:38)
    at org.apache.dubbo.rpc.protocol.rest.RestProtocol.protocolBindingRefer(RestProtocol.java:125)
    at org.apache.dubbo.rpc.protocol.AbstractProtocol.refer(AbstractProtocol.java:138)
    at org.apache.dubbo.qos.protocol.QosProtocolWrapper.refer(QosProtocolWrapper.java:85)
    at org.apache.dubbo.rpc.protocol.ProtocolListenerWrapper.refer(ProtocolListenerWrapper.java:83)
    at org.apache.dubbo.rpc.protocol.ProtocolSecurityWrapper.refer(ProtocolSecurityWrapper.java:107)
    at org.apache.dubbo.rpc.cluster.filter.ProtocolFilterWrapper.refer(ProtocolFilterWrapper.java:74)
    at org.apache.dubbo.rpc.protocol.ProtocolSerializationWrapper.refer(ProtocolSerializationWrapper.java:52)
    at org.apache.dubbo.rpc.protocol.InvokerCountWrapper.refer(InvokerCountWrapper.java:50)
    at org.apache.dubbo.rpc.Protocol$Adaptive.refer(Protocol$Adaptive.java)
    at org.apache.dubbo.registry.integration.RegistryDirectory.toInvokers(RegistryDirectory.java:411)
    at org.apache.dubbo.registry.integration.RegistryDirectory.refreshInvoker(RegistryDirectory.java:273)
    at org.apache.dubbo.registry.integration.RegistryDirectory.refreshOverrideAndInvoker(RegistryDirectory.java:214)
    at org.apache.dubbo.registry.integration.RegistryDirectory.notify(RegistryDirectory.java:190)
    at org.apache.dubbo.registry.support.AbstractRegistry.notify(AbstractRegistry.java:533)
    at org.apache.dubbo.registry.support.FailbackRegistry.doNotify(FailbackRegistry.java:373)
    at org.apache.dubbo.registry.support.FailbackRegistry.notify(FailbackRegistry.java:365)
    at org.apache.dubbo.registry.zookeeper.ZookeeperRegistry.access$200(ZookeeperRegistry.java:61)
    at org.apache.dubbo.registry.zookeeper.ZookeeperRegistry$ZookeeperRegistryNotifier.doNotify(ZookeeperRegistry.java:433)
    at org.apache.dubbo.registry.zookeeper.ZookeeperRegistry$ZookeeperRegistryNotifier.notify(ZookeeperRegistry.java:428)
    at org.apache.dubbo.registry.zookeeper.ZookeeperRegistry$RegistryChildListenerImpl.childChanged(ZookeeperRegistry.java:390)
    at org.apache.dubbo.remoting.zookeeper.curator.CuratorZookeeperClient$CuratorWatcherImpl.lambda$process$0(CuratorZookeeperClient.java:486)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
    at java.lang.Thread.run(Thread.java:750)
AlbumenJ commented 1 year ago

@suncairong163 PTAL

suncairong163 commented 1 year ago

是直接引入了 dubbo-rpc-rest 依赖吗,dubbo rest默认使用 okhttp作为rest-client ,需要okhttp依赖的,建议引入 dubbo-dependencies-bom 或者添加对应的依赖

MartinDai commented 1 year ago

是直接引入了 dubbo-rpc-rest 依赖吗,dubbo rest默认使用 okhttp作为rest-client ,需要okhttp依赖的,建议引入 dubbo-dependencies-bom 或者添加对应的依赖

I was reference config from https://cn.dubbo.apache.org/zh-cn/overview/what/ecosystem/protocol/http/ and just add javax.ws.rs-api and dubbo dependencies, because the documentation doesn't say that additional dependencies are needed. Should the documentation be modified to account for the need for additional dependencies and version information?

MartinDai commented 1 year ago

After add okhttp3 dependencies, the exception was gone

AlbumenJ commented 1 year ago

是直接引入了 dubbo-rpc-rest 依赖吗,dubbo rest默认使用 okhttp作为rest-client ,需要okhttp依赖的,建议引入 dubbo-dependencies-bom 或者添加对应的依赖

I was reference config from https://cn.dubbo.apache.org/zh-cn/overview/what/ecosystem/protocol/http/ and just add javax.ws.rs-api and dubbo dependencies, because the documentation doesn't say that additional dependencies are needed. Should the documentation be modified to account for the need for additional dependencies and version information?

@suncairong163 Would you please help update the docs?

CodePlayer commented 1 year ago

I did NOT use http protocol, i just used tri protocol, however i met the same issue. @AlbumenJ Could you give me some help ? Thanks ~

AlbumenJ commented 1 year ago

I did NOT use http protocol, i just used tri protocol, however i met the same issue.

Could you please provide your configuration files?

CodePlayer commented 1 year ago

I did NOT use http protocol, i just used tri protocol, however i met the same issue.

Could you please provide your configuration files?

dubbo:
  application:
    name: ${spring.application.name}
    register-mode: interface
    serialize-check-status: WARN
    qos-enable: false
  protocol:
    name: tri
    port: -1
    serialization: fastjson2
  registry:
    address: nacos://${spring.cloud.nacos.server-addr}
    username: ${spring.cloud.nacos.username}
    password: ${spring.cloud.nacos.password}
    use-as-metadata-center: true
    use-as-config-center: false
    simplified: true
    extra-keys: retries,owner,side
    parameters:
      namespace: ${spring.cloud.nacos.config.namespace}
    group: ${spring.cloud.nacos.config.group}
  scan:
    base-packages: com.example.**.service
  provider:
    timeout: 3000
  consumer:
    check: false

Thanks for your reply~

CodePlayer commented 1 year ago

Exception stack trce as blow.

The log shows that there is an unsupported protocol.

However we are NOT actively configuring any other protocol than tri.


java.lang.NoClassDefFoundError: okhttp3/OkHttpClient$Builder
    at org.apache.dubbo.remoting.http.restclient.OKHttpRestClient.createHttpClient(OKHttpRestClient.java:145) ~[dubbo-3.2.0.jar:3.2.0]
    at org.apache.dubbo.remoting.http.restclient.OKHttpRestClient.<init>(OKHttpRestClient.java:46) ~[dubbo-3.2.0.jar:3.2.0]
    at org.apache.dubbo.remoting.http.factory.impl.OkHttpClientFactory.doCreateRestClient(OkHttpClientFactory.java:34) ~[dubbo-3.2.0.jar:3.2.0]
    at org.apache.dubbo.remoting.http.factory.AbstractHttpClientFactory.createRestClient(AbstractHttpClientFactory.java:60) ~[dubbo-3.2.0.jar:3.2.0]
    at org.apache.dubbo.remoting.http.factory.RestClientFactory$Adaptive.createRestClient(RestClientFactory$Adaptive.java) ~[dubbo-3.2.0.jar:3.2.0]
    at org.apache.dubbo.rpc.protocol.rest.RestProtocol.createReferenceCountedClient(RestProtocol.java:156) ~[dubbo-3.2.0.jar:3.2.0]
    at org.apache.dubbo.rpc.protocol.rest.RestProtocol.lambda$protocolBindingRefer$1(RestProtocol.java:125) ~[dubbo-3.2.0.jar:3.2.0]
    at java.util.concurrent.ConcurrentHashMap.computeIfAbsent(ConcurrentHashMap.java:1708) ~[?:?]
    at org.apache.dubbo.common.utils.ConcurrentHashMapUtils.computeIfAbsent(ConcurrentHashMapUtils.java:42) ~[dubbo-3.2.0.jar:3.2.0]
    at org.apache.dubbo.rpc.protocol.rest.RestProtocol.protocolBindingRefer(RestProtocol.java:125) ~[dubbo-3.2.0.jar:3.2.0]
    at org.apache.dubbo.rpc.protocol.AbstractProtocol.refer(AbstractProtocol.java:138) ~[dubbo-3.2.0.jar:3.2.0]
    at org.apache.dubbo.rpc.protocol.ProtocolListenerWrapper.refer(ProtocolListenerWrapper.java:83) ~[dubbo-3.2.0.jar:3.2.0]
    at org.apache.dubbo.rpc.protocol.ProtocolSecurityWrapper.refer(ProtocolSecurityWrapper.java:107) ~[dubbo-3.2.0.jar:3.2.0]
    at org.apache.dubbo.qos.protocol.QosProtocolWrapper.refer(QosProtocolWrapper.java:85) ~[dubbo-3.2.0.jar:3.2.0]
    at org.apache.dubbo.rpc.cluster.filter.ProtocolFilterWrapper.refer(ProtocolFilterWrapper.java:74) ~[dubbo-3.2.0.jar:3.2.0]
    at org.apache.dubbo.rpc.protocol.ProtocolSerializationWrapper.refer(ProtocolSerializationWrapper.java:52) ~[dubbo-3.2.0.jar:3.2.0]
    at org.apache.dubbo.rpc.protocol.InvokerCountWrapper.refer(InvokerCountWrapper.java:50) ~[dubbo-3.2.0.jar:3.2.0]
    at org.apache.dubbo.rpc.Protocol$Adaptive.refer(Protocol$Adaptive.java) ~[dubbo-3.2.0.jar:3.2.0]
    at org.apache.dubbo.registry.client.ServiceDiscoveryRegistryDirectory.toInvokers(ServiceDiscoveryRegistryDirectory.java:413) ~[dubbo-3.2.0.jar:3.2.0]
    at org.apache.dubbo.registry.client.ServiceDiscoveryRegistryDirectory.refreshInvoker(ServiceDiscoveryRegistryDirectory.java:307) ~[dubbo-3.2.0.jar:3.2.0]
    at org.apache.dubbo.registry.client.ServiceDiscoveryRegistryDirectory.refreshOverrideAndInvoker(ServiceDiscoveryRegistryDirectory.java:191) ~[dubbo-3.2.0.jar:3.2.0]
    at org.apache.dubbo.registry.client.ServiceDiscoveryRegistryDirectory.notify(ServiceDiscoveryRegistryDirectory.java:183) ~[dubbo-3.2.0.jar:3.2.0]
    at org.apache.dubbo.registry.client.event.listener.ServiceInstancesChangedListener.addListenerAndNotify(ServiceInstancesChangedListener.java:243) ~[dubbo-3.2.0.jar:3.2.0]
    at org.apache.dubbo.registry.client.ServiceDiscoveryRegistry.subscribeURLs(ServiceDiscoveryRegistry.java:329) ~[dubbo-3.2.0.jar:3.2.0]
    at org.apache.dubbo.registry.client.ServiceDiscoveryRegistry.doSubscribe(ServiceDiscoveryRegistry.java:225) ~[dubbo-3.2.0.jar:3.2.0]
    at org.apache.dubbo.registry.client.ServiceDiscoveryRegistry.subscribe(ServiceDiscoveryRegistry.java:187) ~[dubbo-3.2.0.jar:3.2.0]
    at org.apache.dubbo.registry.ListenerRegistryWrapper.subscribe(ListenerRegistryWrapper.java:88) ~[dubbo-3.2.0.jar:3.2.0]
    at org.apache.dubbo.registry.integration.DynamicDirectory.subscribe(DynamicDirectory.java:184) ~[dubbo-3.2.0.jar:3.2.0]
    at org.apache.dubbo.registry.client.ServiceDiscoveryRegistryDirectory.subscribe(ServiceDiscoveryRegistryDirectory.java:134) ~[dubbo-3.2.0.jar:3.2.0]
    at org.apache.dubbo.registry.integration.RegistryProtocol.doCreateInvoker(RegistryProtocol.java:581) ~[dubbo-3.2.0.jar:3.2.0]
    at org.apache.dubbo.registry.integration.InterfaceCompatibleRegistryProtocol.getServiceDiscoveryInvoker(InterfaceCompatibleRegistryProtocol.java:65) ~[dubbo-3.2.0.jar:3.2.0]
    at org.apache.dubbo.registry.client.migration.MigrationInvoker.refreshServiceDiscoveryInvoker(MigrationInvoker.java:440) ~[dubbo-3.2.0.jar:3.2.0]
    at org.apache.dubbo.registry.client.migration.MigrationInvoker.migrateToApplicationFirstInvoker(MigrationInvoker.java:246) ~[dubbo-3.2.0.jar:3.2.0]
    at org.apache.dubbo.registry.client.migration.MigrationRuleHandler.refreshInvoker(MigrationRuleHandler.java:76) ~[dubbo-3.2.0.jar:3.2.0]
    at org.apache.dubbo.registry.client.migration.MigrationRuleHandler.doMigrate(MigrationRuleHandler.java:60) ~[dubbo-3.2.0.jar:3.2.0]
    at org.apache.dubbo.registry.client.migration.MigrationRuleListener.onRefer(MigrationRuleListener.java:249) ~[dubbo-3.2.0.jar:3.2.0]
    at org.apache.dubbo.registry.integration.RegistryProtocol.interceptInvoker(RegistryProtocol.java:546) ~[dubbo-3.2.0.jar:3.2.0]
    at org.apache.dubbo.registry.integration.RegistryProtocol.doRefer(RegistryProtocol.java:516) ~[dubbo-3.2.0.jar:3.2.0]
    at org.apache.dubbo.registry.integration.RegistryProtocol.refer(RegistryProtocol.java:498) ~[dubbo-3.2.0.jar:3.2.0]
    at org.apache.dubbo.rpc.protocol.ProtocolListenerWrapper.refer(ProtocolListenerWrapper.java:80) ~[dubbo-3.2.0.jar:3.2.0]
    at org.apache.dubbo.rpc.protocol.ProtocolSecurityWrapper.refer(ProtocolSecurityWrapper.java:107) ~[dubbo-3.2.0.jar:3.2.0]
    at org.apache.dubbo.qos.protocol.QosProtocolWrapper.refer(QosProtocolWrapper.java:85) ~[dubbo-3.2.0.jar:3.2.0]
    at org.apache.dubbo.rpc.cluster.filter.ProtocolFilterWrapper.refer(ProtocolFilterWrapper.java:71) ~[dubbo-3.2.0.jar:3.2.0]
    at org.apache.dubbo.rpc.protocol.ProtocolSerializationWrapper.refer(ProtocolSerializationWrapper.java:52) ~[dubbo-3.2.0.jar:3.2.0]
    at org.apache.dubbo.rpc.protocol.InvokerCountWrapper.refer(InvokerCountWrapper.java:48) ~[dubbo-3.2.0.jar:3.2.0]
    at org.apache.dubbo.rpc.Protocol$Adaptive.refer(Protocol$Adaptive.java) ~[dubbo-3.2.0.jar:3.2.0]
    at org.apache.dubbo.config.ReferenceConfig.createInvoker(ReferenceConfig.java:586) ~[dubbo-3.2.0.jar:3.2.0]
    at org.apache.dubbo.config.ReferenceConfig.createProxy(ReferenceConfig.java:432) ~[dubbo-3.2.0.jar:3.2.0]
    at org.apache.dubbo.config.ReferenceConfig.init(ReferenceConfig.java:295) ~[dubbo-3.2.0.jar:3.2.0]
    at org.apache.dubbo.config.ReferenceConfig.get(ReferenceConfig.java:231) ~[dubbo-3.2.0.jar:3.2.0]
    at org.apache.dubbo.config.utils.SimpleReferenceCache.get(SimpleReferenceCache.java:132) ~[dubbo-3.2.0.jar:3.2.0]
    at org.apache.dubbo.config.deploy.DefaultModuleDeployer.lambda$referServices$6(DefaultModuleDeployer.java:409) ~[dubbo-3.2.0.jar:3.2.0]
    at java.util.concurrent.ConcurrentHashMap$ValuesView.forEach(ConcurrentHashMap.java:4780) ~[?:?]
    at org.apache.dubbo.config.deploy.DefaultModuleDeployer.referServices(DefaultModuleDeployer.java:389) ~[dubbo-3.2.0.jar:3.2.0]
    at org.apache.dubbo.config.deploy.DefaultModuleDeployer.startSync(DefaultModuleDeployer.java:170) ~[dubbo-3.2.0.jar:3.2.0]
    at org.apache.dubbo.config.deploy.DefaultModuleDeployer.start(DefaultModuleDeployer.java:142) ~[dubbo-3.2.0.jar:3.2.0]
    at org.apache.dubbo.config.spring.context.DubboDeployApplicationListener.onContextRefreshedEvent(DubboDeployApplicationListener.java:113) ~[dubbo-3.2.0.jar:3.2.0]
    at org.apache.dubbo.config.spring.context.DubboDeployApplicationListener.onApplicationEvent(DubboDeployApplicationListener.java:102) ~[dubbo-3.2.0.jar:3.2.0]
    at org.apache.dubbo.config.spring.context.DubboDeployApplicationListener.onApplicationEvent(DubboDeployApplicationListener.java:47) ~[dubbo-3.2.0.jar:3.2.0]
    at org.springframework.context.event.SimpleApplicationEventMulticaster.doInvokeListener(SimpleApplicationEventMulticaster.java:176) ~[spring-context-5.3.27.jar:5.3.27]
    at org.springframework.context.event.SimpleApplicationEventMulticaster.invokeListener(SimpleApplicationEventMulticaster.java:169) ~[spring-context-5.3.27.jar:5.3.27]
    at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:143) ~[spring-context-5.3.27.jar:5.3.27]
    at org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:421) ~[spring-context-5.3.27.jar:5.3.27]
    at org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:378) ~[spring-context-5.3.27.jar:5.3.27]
    at org.springframework.context.support.AbstractApplicationContext.finishRefresh(AbstractApplicationContext.java:940) ~[spring-context-5.3.27.jar:5.3.27]
    at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:586) ~[spring-context-5.3.27.jar:5.3.27]
    at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:145) ~[spring-boot-2.6.14.jar:2.6.14]
    at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:745) ~[spring-boot-2.6.14.jar:2.6.14]
    at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:423) ~[spring-boot-2.6.14.jar:2.6.14]
    at org.springframework.boot.SpringApplication.run(SpringApplication.java:307) ~[spring-boot-2.6.14.jar:2.6.14]
Caused by: java.lang.ClassNotFoundException: okhttp3.OkHttpClient$Builder
    ... 74 more

2023-05-13 11:06:55.723  INFO 19240 --- [           main] .d.r.c.ServiceDiscoveryRegistryDirectory :  [DUBBO] Refreshed invoker size 0, dubbo version: 3.2.0, current host: 192.168.10.66
2023-05-13 11:06:55.723 ERROR 19240 --- [           main] .d.r.c.ServiceDiscoveryRegistryDirectory :  [DUBBO] Unsupported protocol., dubbo version: 3.2.0, current host: 192.168.10.66, error code: 4-1. This may be caused by , go to https://dubbo.apache.org/faq/4/1 to find instructions. 

java.lang.IllegalStateException: Cannot create invokers from url address list (total 3)
    at org.apache.dubbo.registry.client.ServiceDiscoveryRegistryDirectory.refreshInvoker(ServiceDiscoveryRegistryDirectory.java:311) ~[dubbo-3.2.0.jar:3.2.0]
    at org.apache.dubbo.registry.client.ServiceDiscoveryRegistryDirectory.refreshOverrideAndInvoker(ServiceDiscoveryRegistryDirectory.java:191) ~[dubbo-3.2.0.jar:3.2.0]
    at org.apache.dubbo.registry.client.ServiceDiscoveryRegistryDirectory.notify(ServiceDiscoveryRegistryDirectory.java:183) ~[dubbo-3.2.0.jar:3.2.0]
    at org.apache.dubbo.registry.client.event.listener.ServiceInstancesChangedListener.addListenerAndNotify(ServiceInstancesChangedListener.java:243) ~[dubbo-3.2.0.jar:3.2.0]
    at org.apache.dubbo.registry.client.ServiceDiscoveryRegistry.subscribeURLs(ServiceDiscoveryRegistry.java:329) ~[dubbo-3.2.0.jar:3.2.0]
    at org.apache.dubbo.registry.client.ServiceDiscoveryRegistry.doSubscribe(ServiceDiscoveryRegistry.java:225) ~[dubbo-3.2.0.jar:3.2.0]
    at org.apache.dubbo.registry.client.ServiceDiscoveryRegistry.subscribe(ServiceDiscoveryRegistry.java:187) ~[dubbo-3.2.0.jar:3.2.0]
    at org.apache.dubbo.registry.ListenerRegistryWrapper.subscribe(ListenerRegistryWrapper.java:88) ~[dubbo-3.2.0.jar:3.2.0]
    at org.apache.dubbo.registry.integration.DynamicDirectory.subscribe(DynamicDirectory.java:184) ~[dubbo-3.2.0.jar:3.2.0]
    at org.apache.dubbo.registry.client.ServiceDiscoveryRegistryDirectory.subscribe(ServiceDiscoveryRegistryDirectory.java:134) ~[dubbo-3.2.0.jar:3.2.0]
    at org.apache.dubbo.registry.integration.RegistryProtocol.doCreateInvoker(RegistryProtocol.java:581) ~[dubbo-3.2.0.jar:3.2.0]
    at org.apache.dubbo.registry.integration.InterfaceCompatibleRegistryProtocol.getServiceDiscoveryInvoker(InterfaceCompatibleRegistryProtocol.java:65) ~[dubbo-3.2.0.jar:3.2.0]
    at org.apache.dubbo.registry.client.migration.MigrationInvoker.refreshServiceDiscoveryInvoker(MigrationInvoker.java:440) ~[dubbo-3.2.0.jar:3.2.0]
    at org.apache.dubbo.registry.client.migration.MigrationInvoker.migrateToApplicationFirstInvoker(MigrationInvoker.java:246) ~[dubbo-3.2.0.jar:3.2.0]
    at org.apache.dubbo.registry.client.migration.MigrationRuleHandler.refreshInvoker(MigrationRuleHandler.java:76) ~[dubbo-3.2.0.jar:3.2.0]
    at org.apache.dubbo.registry.client.migration.MigrationRuleHandler.doMigrate(MigrationRuleHandler.java:60) ~[dubbo-3.2.0.jar:3.2.0]
    at org.apache.dubbo.registry.client.migration.MigrationRuleListener.onRefer(MigrationRuleListener.java:249) ~[dubbo-3.2.0.jar:3.2.0]
    at org.apache.dubbo.registry.integration.RegistryProtocol.interceptInvoker(RegistryProtocol.java:546) ~[dubbo-3.2.0.jar:3.2.0]
    at org.apache.dubbo.registry.integration.RegistryProtocol.doRefer(RegistryProtocol.java:516) ~[dubbo-3.2.0.jar:3.2.0]
    at org.apache.dubbo.registry.integration.RegistryProtocol.refer(RegistryProtocol.java:498) ~[dubbo-3.2.0.jar:3.2.0]
    at org.apache.dubbo.rpc.protocol.ProtocolListenerWrapper.refer(ProtocolListenerWrapper.java:80) ~[dubbo-3.2.0.jar:3.2.0]
    at org.apache.dubbo.rpc.protocol.ProtocolSecurityWrapper.refer(ProtocolSecurityWrapper.java:107) ~[dubbo-3.2.0.jar:3.2.0]
    at org.apache.dubbo.qos.protocol.QosProtocolWrapper.refer(QosProtocolWrapper.java:85) ~[dubbo-3.2.0.jar:3.2.0]
    at org.apache.dubbo.rpc.cluster.filter.ProtocolFilterWrapper.refer(ProtocolFilterWrapper.java:71) ~[dubbo-3.2.0.jar:3.2.0]
    at org.apache.dubbo.rpc.protocol.ProtocolSerializationWrapper.refer(ProtocolSerializationWrapper.java:52) ~[dubbo-3.2.0.jar:3.2.0]
    at org.apache.dubbo.rpc.protocol.InvokerCountWrapper.refer(InvokerCountWrapper.java:48) ~[dubbo-3.2.0.jar:3.2.0]
    at org.apache.dubbo.rpc.Protocol$Adaptive.refer(Protocol$Adaptive.java) ~[dubbo-3.2.0.jar:3.2.0]
    at org.apache.dubbo.config.ReferenceConfig.createInvoker(ReferenceConfig.java:586) ~[dubbo-3.2.0.jar:3.2.0]
    at org.apache.dubbo.config.ReferenceConfig.createProxy(ReferenceConfig.java:432) ~[dubbo-3.2.0.jar:3.2.0]
    at org.apache.dubbo.config.ReferenceConfig.init(ReferenceConfig.java:295) ~[dubbo-3.2.0.jar:3.2.0]
    at org.apache.dubbo.config.ReferenceConfig.get(ReferenceConfig.java:231) ~[dubbo-3.2.0.jar:3.2.0]
    at org.apache.dubbo.config.utils.SimpleReferenceCache.get(SimpleReferenceCache.java:132) ~[dubbo-3.2.0.jar:3.2.0]
    at org.apache.dubbo.config.deploy.DefaultModuleDeployer.lambda$referServices$6(DefaultModuleDeployer.java:409) ~[dubbo-3.2.0.jar:3.2.0]
    at java.util.concurrent.ConcurrentHashMap$ValuesView.forEach(ConcurrentHashMap.java:4780) ~[?:?]
    at org.apache.dubbo.config.deploy.DefaultModuleDeployer.referServices(DefaultModuleDeployer.java:389) ~[dubbo-3.2.0.jar:3.2.0]
    at org.apache.dubbo.config.deploy.DefaultModuleDeployer.startSync(DefaultModuleDeployer.java:170) ~[dubbo-3.2.0.jar:3.2.0]
    at org.apache.dubbo.config.deploy.DefaultModuleDeployer.start(DefaultModuleDeployer.java:142) ~[dubbo-3.2.0.jar:3.2.0]
    at org.apache.dubbo.config.spring.context.DubboDeployApplicationListener.onContextRefreshedEvent(DubboDeployApplicationListener.java:113) ~[dubbo-3.2.0.jar:3.2.0]
    at org.apache.dubbo.config.spring.context.DubboDeployApplicationListener.onApplicationEvent(DubboDeployApplicationListener.java:102) ~[dubbo-3.2.0.jar:3.2.0]
    at org.apache.dubbo.config.spring.context.DubboDeployApplicationListener.onApplicationEvent(DubboDeployApplicationListener.java:47) ~[dubbo-3.2.0.jar:3.2.0]
    at org.springframework.context.event.SimpleApplicationEventMulticaster.doInvokeListener(SimpleApplicationEventMulticaster.java:176) ~[spring-context-5.3.27.jar:5.3.27]
    at org.springframework.context.event.SimpleApplicationEventMulticaster.invokeListener(SimpleApplicationEventMulticaster.java:169) ~[spring-context-5.3.27.jar:5.3.27]
    at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:143) ~[spring-context-5.3.27.jar:5.3.27]
    at org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:421) ~[spring-context-5.3.27.jar:5.3.27]
    at org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:378) ~[spring-context-5.3.27.jar:5.3.27]
    at org.springframework.context.support.AbstractApplicationContext.finishRefresh(AbstractApplicationContext.java:940) ~[spring-context-5.3.27.jar:5.3.27]
    at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:586) ~[spring-context-5.3.27.jar:5.3.27]
    at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:145) ~[spring-boot-2.6.14.jar:2.6.14]
    at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:745) ~[spring-boot-2.6.14.jar:2.6.14]
    at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:423) ~[spring-boot-2.6.14.jar:2.6.14]
    at org.springframework.boot.SpringApplication.run(SpringApplication.java:307) ~[spring-boot-2.6.14.jar:2.6.14]
CodePlayer commented 1 year ago

Based on issue #11852, I've found a solution. I change dubbo.registry.group to the another name (e.g. dubbo ), it works fine.

CodePlayer commented 1 year ago

BTW, prior to dubbo 3.2.0, we used the dubbo protoco. It did NOT encounter this problem at that time.

AlbumenJ commented 1 year ago

Based on issue #11852, I've found a solution. I change dubbo.registry.group to the another name (e.g. dubbo ), it works fine.

Did you deploy spring cloud and dubbo in the same nacos namespace?

CodePlayer commented 1 year ago

Based on issue #11852, I've found a solution. I change dubbo.registry.group to the another name (e.g. dubbo ), it works fine.

Did you deploy spring cloud and dubbo in the same nacos namespace?

Yes, it is.

AlbumenJ commented 1 year ago

Based on issue #11852, I've found a solution. I change dubbo.registry.group to the another name (e.g. dubbo ), it works fine.

Did you deploy spring cloud and dubbo in the same nacos namespace?

Yes, it is.

Separate spring cloud and dubbo into two ns.

hhy3189 commented 4 months ago
       <dependency>
            <groupId>com.ejlchina</groupId>
            <artifactId>okhttps</artifactId>
            <version>3.5.3</version>
        </dependency>
        <dependency>
            <groupId>com.ejlchina</groupId>
            <artifactId>okhttps-fastjson</artifactId>
            <version>3.5.3</version>
        </dependency>

我也遇到了,我加入以上两个依赖,解决了这个报错问题。dubbo3.2.13+nacos2.23 ,但是我用dubbo3.2.10一下都有各种相关报错。可能后续版本修复了