An attempt was made to call a method that does not exist. The attempt was made from the following

本文涉及的产品
云原生网关 MSE Higress,422元/月
注册配置 MSE Nacos/ZooKeeper,118元/月
服务治理 MSE Sentinel/OpenSergo,Agent数量 不受限
简介: An attempt was made to call a method that does not exist. The attempt was made from the following

spring boot 整合 duboo+zookeeper报错信息如下:

org.apache.curator.utils.DefaultZookeeperFactory.newZooKeeper

***************************
APPLICATION FAILED TO START
***************************
Description:
An attempt was made to call a method that does not exist. The attempt was made from the following location:
    org.apache.curator.utils.DefaultZookeeperFactory.newZooKeeper(DefaultZookeeperFactory.java:29)
The following method did not exist:
    org.apache.zookeeper.ZooKeeper.<init>(Ljava/lang/String;ILorg/apache/zookeeper/Watcher;Z)V
The method's class, org.apache.zookeeper.ZooKeeper, is available from the following locations:
    jar:file:/D:/javaHj/maven/maven-repository/org/apache/zookeeper/zookeeper/3.3.3/zookeeper-3.3.3.jar!/org/apache/zookeeper/ZooKeeper.class
It was loaded from the following location:
    file:/D:/javaHj/maven/maven-repository/org/apache/zookeeper/zookeeper/3.3.3/zookeeper-3.3.3.jar
Action:
Correct the classpath of your application so that it contains a single, compatible version of org.apache.zookeeper.ZooKeeper


解决方法:

只需要在zkclient中去除zookeeper依赖


<dependency>
            <groupId>com.github.sgroschupf</groupId>
            <artifactId>zkclient</artifactId>
            <version>0.1</version>
            <exclusions>
                <exclusion>
                    <groupId>org.apache.zookeeper</groupId>
                    <artifactId>zookeeper</artifactId>
                </exclusion>
            </exclusions>
        </dependency>


相关实践学习
基于MSE实现微服务的全链路灰度
通过本场景的实验操作,您将了解并实现在线业务的微服务全链路灰度能力。
目录
相关文章
getReader() has already been called for this request
getReader() has already been called for this request
1729 0
getReader() has already been called for this request
ERROR: Encountered errors while bringing up the project.
ERROR: Encountered errors while bringing up the project.
193 0
|
Java Maven
An attempt was made to call a method that does not exist. The attempt was made from the following
An attempt was made to call a method that does not exist. The attempt was made from the following
518 0
|
XML Java 数据格式
Exception encountered during context initialization - cancelling refresh attempt
Exception encountered during context initialization - cancelling refresh attempt:
357 0
排错-Error--memory violation Exception ACCESS_VIOLATION received解决方
排错-Error--memory violation Exception ACCESS_VIOLATION received解决方
257 0
|
Java 应用服务中间件
Unable to start ServletWebServerApplicationContext due to missing ServletWebServerFactory bean.
Unable to start ServletWebServerApplicationContext due to missing ServletWebServerFactory bean.
Unable to start ServletWebServerApplicationContext due to missing ServletWebServerFactory bean.
abort: error: Temporary failure in name resolution
abort: error: Temporary failure in name resolution
208 0
|
前端开发
【已解决】Expected the Promise rejection reason to be an Error
Expected the Promise rejection reason to be an Error
396 0
报错解决:Reason: Failed to determine a suitable driver class
报错解决:Reason: Failed to determine a suitable driver class
2580 0
报错解决:Reason: Failed to determine a suitable driver class