embeddedkafka / embedded-kafka

A library that provides an in-memory Kafka instance to run your tests against.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Zookeeper dependency issue for version 2.2.1

PnPie opened this issue · comments

commented

Issue:
I'm getting this exception java.lang.classnotfoundexception: org.apache.zookeeper.asynccallback$multicallback while running:

        <dependency>
            <groupId>io.github.embeddedkafka</groupId>
            <artifactId>embedded-kafka_2.11</artifactId>
            <version>2.2.1</version>
            <scope>test</scope>
        </dependency>

Which is actually because the api org.apache.zookeeper.asynccallback has been added since zookeeper 3.4.7, but the above version brings zookeeper 3.4.6, so that causes java.lang.classnotfoundexception.

Workaround:
Excludes zookeeper dependencies in embedded-kafka and in addition add the right version:

        <dependency>
            <groupId>io.github.embeddedkafka</groupId>
            <artifactId>embedded-kafka_2.11</artifactId>
            <version>2.2.1</version>
            <scope>test</scope>
            <exclusions>
                <exclusion>
                    <groupId>org.apache.zookeeper</groupId>
                    <artifactId>zookeeper</artifactId>
                </exclusion>
            </exclusions>
        </dependency>
        <dependency>
            <groupId>org.apache.zookeeper</groupId>
            <artifactId>zookeeper</artifactId>
            <version>3.4.7</version>
            <scope>test</scope>
        </dependency>

Hi @PnPie, I just checked out v2.2.1 and I see Apache Kafka importing ZooKeeper 3.4.13 (you can check it on Maven Central too) which provides the class you're mentioning..

commented

Hi @francescopellegrini
Yeah I checked and it's actually some packages else that bring the wrong zookeeper dependency for me, the embedded-kafka package works well, so I close the issue.
Thanks for your quick reply.