如何解决java.lang.noclassdeffounderror:org/apache/curator/retrypolicy in storm

5sxhfpxr  于 2021-06-08  发布在  Kafka
关注(0)|答案(2)|浏览(508)

我该怎么解决
java.lang.noclassdeffounderror:com/google/common/base/preconditions,位于org.apache.curator.emble.fixed.fixedSembleProvider.(fixedSembleProvider)。java:39)在org.apache.curator.framework上。

noclassdeffounderror:org/apache/curator/retrypolicy
在风暴Kafka整合。
我正在使用:
Kafka2.9.2-0.8.1.1
Zookeeper-3.4.6
风暴-0.9.3
更新
pom.xml文件

<dependency>
        <groupId>org.scala-lang</groupId>
        <artifactId>scala-reflect</artifactId>
        <version>2.10.2</version>
    </dependency>
    <dependency>
        <groupId>org.apache.storm</groupId>
        <artifactId>storm-kafka</artifactId>
        <version>0.9.3</version>
    </dependency>
    <dependency>
        <groupId>org.apache.kafka</groupId>
        <artifactId>kafka_2.9.2</artifactId>
        <version>0.8.1.1</version>
    </dependency>
    <dependency>
        <groupId>org.apache.zookeeper</groupId>
        <artifactId>zookeeper</artifactId>
        <version>3.4.6</version>
        <exclusions>
            <exclusion>
                <groupId>com.sun.jmx</groupId>
                <artifactId>jmxri</artifactId>
            </exclusion>
            <exclusion>
                <groupId>com.sun.jdmk</groupId>
                <artifactId>jmxtools</artifactId>
            </exclusion>
            <exclusion>
                <groupId>javax.jms</groupId>
                <artifactId>jms</artifactId>
            </exclusion>
        </exclusions>
    </dependency>
    <dependency>
        <groupId>org.apache.storm</groupId>
        <artifactId>storm-core</artifactId>
        <version>0.9.3</version>
    </dependency>
    <dependency>
        <groupId>redis.clients</groupId>
        <artifactId>jedis</artifactId>
        <version>2.6.0</version>
        <type>jar</type>
        <scope>compile</scope>
    </dependency>
c0vxltue

c0vxltue1#

在pom.xml中添加以下行

<dependency>
  <groupId>org.apache.curator</groupId>
  <artifactId>curator-test</artifactId>
  <version>2.4.0</version>
  <exclusions>
    <exclusion>
      <groupId>org.jboss.netty</groupId>
      <artifactId>netty</artifactId>
    </exclusion>
    <exclusion>
      <groupId>org.slf4j</groupId>
      <artifactId>slf4j-log4j12</artifactId>
    </exclusion>
  </exclusions>
</dependency>
7qhs6swi

7qhs6swi2#

为了 org/apache/curator/RetryPolicy ,您应该使用

<dependency>
  <groupId>org.apache.curator</groupId>
  <artifactId>curator-client</artifactId>
  <version>2.11.0</version>
</dependency>

Zookeeper须知 3.4.6 ,与策展人兼容的最新版本是 2.11.0 .
然而 curator-client 也需要 curator-framework . 所以你可以加上

<dependency>
  <groupId>org.apache.curator</groupId>
  <artifactId>curator-framework</artifactId>
  <version>2.11.0</version>
</dependency>

相关问题