apache / dubbo

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

[Bug] version:3.2.14+ Builder org.apache.curator.framework.CuratorFrameworkFactory$Builder.ensembleTracker(boolean) #14559

Closed ddwwbb closed 2 months ago

ddwwbb commented 2 months ago

Pre-check

Search before asking

Apache Dubbo Component

Java SDK (apache/dubbo)

Dubbo Version

Dubbo java 3.2.14+ , jdk 17 ,zk 3.4.10

Steps to reproduce this issue

when use pom.xml

org.apache.curator curator-recipes 4.3.0 org.apache.zookeeper zookeeper
    <dependency>
        <groupId>org.apache.curator</groupId>
        <artifactId>curator-framework</artifactId>
        <version>4.3.0</version>
    </dependency>
    <dependency>
        <groupId>org.apache.curator</groupId>
        <artifactId>curator-x-discovery-server</artifactId>
        <version>4.3.0</version>
    </dependency>
    <dependency>
        <groupId>org.apache.zookeeper</groupId>
        <artifactId>zookeeper</artifactId>
        <version>3.4.10</version>
    </dependency>

error: org.apache.curator.framework.CuratorFrameworkFactory$Builder org.apache.curator.framework.CuratorFrameworkFactory$Builder.ensembleTracker(boolean)

What you expected to happen

Caused by: java.lang.NoSuchMethodError: 'org.apache.curator.framework.CuratorFrameworkFactory$Builder org.apache.curator.framework.CuratorFrameworkFactory$Builder.ensembleTracker(boolean)' at org.apache.dubbo.registry.zookeeper.util.CuratorFrameworkUtils.buildCuratorFramework(CuratorFrameworkUtils.java:76) at org.apache.dubbo.registry.zookeeper.ZookeeperServiceDiscovery.(ZookeeperServiceDiscovery.java:83) at org.apache.dubbo.registry.zookeeper.ZookeeperServiceDiscoveryFactory.createDiscovery(ZookeeperServiceDiscoveryFactory.java:27) at org.apache.dubbo.registry.client.AbstractServiceDiscoveryFactory.lambda$getServiceDiscovery$0(AbstractServiceDiscoveryFactory.java:54) at java.base/java.util.concurrent.ConcurrentHashMap.computeIfAbsent(ConcurrentHashMap.java:1708) at org.apache.dubbo.common.utils.ConcurrentHashMapUtils.computeIfAbsent(ConcurrentHashMapUtils.java:56) at org.apache.dubbo.registry.client.AbstractServiceDiscoveryFactory.getServiceDiscovery(AbstractServiceDiscoveryFactory.java:54) at org.apache.dubbo.registry.client.ServiceDiscoveryRegistry.getServiceDiscovery(ServiceDiscoveryRegistry.java:133) at org.apache.dubbo.registry.client.ServiceDiscoveryRegistry.createServiceDiscovery(ServiceDiscoveryRegistry.java:119) at org.apache.dubbo.registry.client.ServiceDiscoveryRegistry.(ServiceDiscoveryRegistry.java:94) at org.apache.dubbo.registry.client.ServiceDiscoveryRegistryFactory.createRegistry(ServiceDiscoveryRegistryFactory.java:40) at org.apache.dubbo.registry.support.AbstractRegistryFactory.getRegistry(AbstractRegistryFactory.java:95) at org.apache.dubbo.registry.RegistryFactoryWrapper.getRegistry(RegistryFactoryWrapper.java:33) at org.apache.dubbo.registry.RegistryFactory$Adaptive.getRegistry(RegistryFactory$Adaptive.java) at org.apache.dubbo.registry.integration.RegistryProtocol.getRegistry(RegistryProtocol.java:459) at org.apache.dubbo.registry.integration.RegistryProtocol.export(RegistryProtocol.java:266) at org.apache.dubbo.qos.protocol.QosProtocolWrapper.export(QosProtocolWrapper.java:79) at org.apache.dubbo.rpc.protocol.ProtocolSecurityWrapper.export(ProtocolSecurityWrapper.java:84) at org.apache.dubbo.rpc.protocol.ProtocolListenerWrapper.export(ProtocolListenerWrapper.java:66) at org.apache.dubbo.rpc.cluster.filter.ProtocolFilterWrapper.export(ProtocolFilterWrapper.java:58) at org.apache.dubbo.rpc.protocol.ProtocolSerializationWrapper.export(ProtocolSerializationWrapper.java:50) at org.apache.dubbo.rpc.protocol.InvokerCountWrapper.export(InvokerCountWrapper.java:42) at org.apache.dubbo.rpc.Protocol$Adaptive.export(Protocol$Adaptive.java) at org.apache.dubbo.config.ServiceConfig.doExportUrl(ServiceConfig.java:947) at org.apache.dubbo.config.ServiceConfig.exportRemote(ServiceConfig.java:917) at org.apache.dubbo.config.ServiceConfig.exportUrl(ServiceConfig.java:857) at org.apache.dubbo.config.ServiceConfig.doExportUrlsFor1Protocol(ServiceConfig.java:602) at org.apache.dubbo.config.ServiceConfig.doExportUrls(ServiceConfig.java:583) at org.apache.dubbo.config.ServiceConfig.doExport(ServiceConfig.java:540) at org.apache.dubbo.config.ServiceConfig.export(ServiceConfig.java:340) at org.apache.dubbo.config.deploy.DefaultModuleDeployer.exportServiceInternal(DefaultModuleDeployer.java:477) at org.apache.dubbo.config.deploy.DefaultModuleDeployer.exportServices(DefaultModuleDeployer.java:424) at org.apache.dubbo.config.deploy.DefaultModuleDeployer.startSync(DefaultModuleDeployer.java:174) at org.apache.dubbo.config.deploy.DefaultModuleDeployer.start(DefaultModuleDeployer.java:156) at org.apache.dubbo.config.spring.context.DubboDeployApplicationListener.onContextRefreshedEvent(DubboDeployApplicationListener.java:157) at org.apache.dubbo.config.spring.context.DubboDeployApplicationListener.onApplicationEvent(DubboDeployApplicationListener.java:143) at org.apache.dubbo.config.spring.context.DubboDeployApplicationListener.onApplicationEvent(DubboDeployApplicationListener.java:52) at org.springframework.context.event.SimpleApplicationEventMulticaster.doInvokeListener(SimpleApplicationEventMulticaster.java:185) at org.springframework.context.event.SimpleApplicationEventMulticaster.invokeListener(SimpleApplicationEventMulticaster.java:178) at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:156) at org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:451) at org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:384) at org.springframework.context.support.AbstractApplicationContext.finishRefresh(AbstractApplicationContext.java:984) at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:627) at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:146) at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:754) at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:456) at org.springframework.boot.SpringApplication.run(SpringApplication.java:335)

Anything else

No response

Are you willing to submit a pull request to fix on your own?

Code of Conduct

wcy666103 commented 2 months ago

This feels like a dependency versioning problem, can you provide a way to reproduce the code in a public repository?

ddwwbb commented 2 months ago

use

        <dependency>
            <groupId>org.apache.dubbo</groupId>
            <artifactId>dubbo-spring-boot-starter</artifactId>
            <version>3.2.14</version>
        </dependency>

can Reappear error ,

        <dependency>
            <groupId>org.apache.dubbo</groupId>
            <artifactId>dubbo</artifactId>
            <version>3.2.14</version>
        </dependency>

no error

funky-eyes commented 2 months ago

I think you should introduce 5.x curator dependencies

ddwwbb commented 2 months ago

I think you should introduce 5.x curator dependencies

but use zookeeper 3.4.10,can't use 5.x curator

aofall commented 2 months ago

Looks like #14285 caused a breaking changes.

Although the dubbo-registry-zookeeper module introduces curator5 dependency default, but all the class and method are also exist in curator4 so it works fine before the #14285 pull request.

The new version of dubbo 3.3 only support curator5 and above, consider to upgrade the zookeeper to 3.5.x and above that prevent dependency and version problems